In this post, you’ll learn about the error message -556 a privilege cannot be revoked because grant is to public in the IBM DB2 database , the reason why it occurs along with the solution to fix it
IBM DB2 Error Message
-556 a privilege cannot be revoked because grant is to public
Reason for the Error
The REVOKE statement was not successful because of one of the following reasons: *�� The revokee, ‘authid2’, does not possess the ‘privilege’ *�� The revoker, ‘authid1’, did not explicitly grant the privilege to ‘authid2’� *�� ‘Authid2’ is the owner of the specified object.An authorization ID can REVOKE only the ‘privileges’ that it has explicitly granted to other authorization IDs, unless the authorization ID has SYSADM or SYSCTRL authority and specifies the BY clause.� No authorization ID, not even SYSADM, can revoke ‘privileges’ on an object from the object owner.
Solution
Check the appropriate authorization catalog tables to verify that the revokee ‘authid2’ possesses the privilege to be revoked.� Queries can be made with GRANTEE = ‘authid2’ and the privilege column not = blanks.� Correct and re issue the REVOKE statement.Note:�� If a user holding SYSADM or SYSCTRL authority receives this SQLCODE, the ‘BY’ clause may have been omitted from the REVOKE statement.