Please follow the links at the bottom of this reply. They look likely to be the solution to your problem. It details a fix pack which you may need to install. Look at
JR16205 GRANT USAGE ON SEQUENCE DOES NOT BEHAVE CORRECTLY.
APAR Description:
PROBLEM SUMMARY: The values command returns SQL0551N error
even when the public is granted usage on the sequence..
.
db2 grant usage on sequence user1.seq1 to public
db2 connect to madinc user user2 using pwd
db2 values(nextval for user1.seq1) --> SQL0551N
TEMPORARY FIX: none
ERROR DESCRIPTION:
Grant usage on sequence behaves incorrectly. Here is a scenario
- db2 connect to madinc user user1 using pwd
- db2 create sequence seq1
- db2 grant usage on sequence user1.seq1 to public
- db2 connect to madinc user user2 using pwd
- db2 values(newtval for user1.seq1)
SQL0551N "USER2" does not have the privilege to perform operatio
n "USAGE" on object "USER1.SEQ1". SQLSTATE=4501
LOCAL FIX:
none