DB2 SQL Errors Codes and Error Messages and Warnings from Error +552 to +561

SQLServerF1

Error: DB2 SQL Error: SQLCODE=+552, SQLSTATE=01542, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
auth-id DOES NOT HAVE THE
PRIVILEGE TO PERFORM
OPERATION operation
Explanation: Authorization ID auth-id has attempted
to perform the specified operation without having been
granted the authority to do so.
If you are using a trusted context, the token auth-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
System action: A valid plan or package will be
created if no errors are detected. The statement is
bound dynamically on each execution of the statement.
Programmer response: For better performance, rebind
the plan or package after correcting the statement. To
correct the statement, ensure that the authorization-ID
has been granted the authority necessary to perform
the desired operation.
SQLSTATE: 01542

Error: DB2 SQL Error: SQLCODE=+558, SQLSTATE=01516, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE WITH GRANT OPTION IS
IGNORED
Explanation: The WITH GRANT option was used
where it is not valid. It cannot be used in the following
cases:
v PUBLIC was within the list of grantee authorization
IDs.
v The BINDAGENT privilege was being granted.
v The ANY package privilege on collection-id.* was
being granted.
System action: The offending privileges in the
authorization specification are granted without the
GRANT option. If the grantee is PUBLIC, all the
privileges in the authorization specification are granted
without the GRANT option.
SQLSTATE: 01516

Error: DB2 SQL Error: SQLCODE=+561, SQLSTATE=01523, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE ALTER, INDEX, REFERENCES,
AND TRIGGER PRIVILEGES
CANNOT BE GRANTED PUBLIC AT
ALL LOCATIONS
Explanation: A GRANT statement was specified with
either an ALL or ALL PRIVILEGES keyword. ALL and
ALL PRIVILEGES imply the granting of ALTER,
INDEX, REFERENCES, and TRIGGER privileges, and
these privileges cannot be granted to a remote user.
System action: DB2 executes the GRANT statement.
However, it does not grant the ALTER, INDEX,
REFERENCES, or TRIGGER privileges to PUBLIC*.
SQLSTATE: 01523

Above are list of DB2 SQL Errors and Warnings from Error +552 to +561 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 *