DB2 SQL Errors Codes and Error Messages and Warnings from Error -554 to -556

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-554, SQLSTATE=42502, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
AN AUTHORIZATION ID OR ROLE
CANNOT GRANT A PRIVILEGE TO
ITSELF
Explanation: An authorization ID or a role attempted
to execute a GRANT statement in which that ID itself
appears as one of the entries in the list of ‘grantee’
authorization IDs or role names.
An authorization ID or a role cannot GRANT a
privilege to itself. However, if SQLRULES(STD) is in
effect or CURRENT RULES contains STD, GRANT to
self is allowed.
System action: The statement cannot be executed. No
privileges were granted.
Programmer response: Refer to chapter 4 of SQL
Reference for information about restrictions on the use
of the GRANT statement.
SQLSTATE: 42502

Error: DB2 SQL Error: SQLCODE=-555, SQLSTATE=42502, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
AN AUTHORIZATION ID OR ROLE
CANNOT REVOKE A PRIVILEGE
FROM ITSELF
Explanation: An authorization ID or a role attempted
to execute a REVOKE statement in which that ID itself
appears as one of the entries in the list of authorization
IDs or role names to be revoked.
An authorization ID or a role cannot REVOKE its own
privilege. However, if SQLRULES(STD) is in effect or
CURRENT RULES contains STD, REVOKE from self is
allowed.
System action: The statement cannot be executed. No
privileges were revoked.
Programmer response: Refer to chapter 2 of SQL
Reference for information about restrictions on the use
of the REVOKE statement.
SQLSTATE: 42502

Error: DB2 SQL Error: SQLCODE=-556, SQLSTATE=42504, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
revoke-target CANNOT HAVE THE
privilege PRIVILEGE object-name
REVOKED BY revoker-id BECAUSE THE
REVOKEE DOES NOT POSSESS THE
PRIVILEGE OR THE REVOKER DID
NOT MAKE THE GRANT
Explanation: The REVOKE statement was not
successful.
revoke-target
The authorization ID that the revoke attempt
was made against.
privilege
The name of the privilege that was to be
revoked.
object-name
The name of the object that the privilege
applies to.
revoker-id
The authorization ID that attempted to revoke
the privilege.
If you are using a trusted context, the tokens
revoke-target and revoker-id might return a role instead of
an authorization ID. A role is returned if a role was in
effect and the authorization checking is performed
against the role, rather than the authorization ID of the
session, when the condition was encountered.
Otherwise an authorization ID is returned. A role is
returned in the following format as a single token:
ROLE: role-name
A failed revocation attempt is commonly caused by one
or more of the following conditions:
v The authorization ID that was the target of the
REVOKE statement, revoke-target, does not possess
the privilege that was to be revoked.
v The revoking authorization ID, revoker-id, did not
explicitly grant the privilege to revoke-target. 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.
v The authorization ID revoke-target is the owner of the
specified object. No authorization ID, not even
SYSADM, can revoke privileges on an object from
the object owner.
v If privilege is “***”: The keyword ALL was used in
the REVOKE statement, but revoke-target did not
possess any privilege to revoke.
v If revoker-id is “ALL”: The BY ALL clause was used
in the REVOKE statement, but revoke-target did not
possess any privilege to revoke.
v If revoker-id holds SYSADM or SYSCTRL authority:
The BY clause might have been omitted from the
REVOKE statement.
System action: The statement was not executed. No
privileges were revoked from any authorization ID.
Programmer response: Check the appropriate
authorization catalog tables to verify that revoke-target
possesses the privilege to be revoked. Issue a query
with GRANTEE set to the value in revoke-target and the
privilege column not equal to blanks. Correct and
reissue the REVOKE statement.
SQLSTATE: 42504

Above are list of DB2 SQL Errors and Warnings from Error -554 to -556 received while performing certain operation against DB2 Database or related products.

SQLCODE – Regardless of whether the application program provides an SQLCA or a stand-alone variable, SQLCODE is set by DB2 after each SQL statement is
executed. DB2 conforms to the ISO/ANSI SQL standard as follows:
If SQLCODE = 0, execution was successful.
If SQLCODE > 0, execution was successful with a warning.
If SQLCODE < 0, execution was not successful.
SQLCODE = 100, “no data” was found. For example, a FETCH statement returned no data because the cursor was positioned after the last row of the result table.

SQLSTATE – SQLSTATE is also set by DB2 after the execution of each SQL statement. Thus, application programs can check the execution of SQL statements by testing SQLSTATE instead of SQLCODE.

Hope this was helpful.

Thanks,
SQLServerF1 Team
Information about DB2 SQL Error Codes and Error Messages on Windows, Linux and Z/OS Operating Systems.

 

Leave a Reply

Your email address will not be published. Required fields are marked *