DB2 SQL Errors Codes and Error Messages and Warnings from Error -079 to -087

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-079, SQLSTATE=428EK, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
QUALIFIER FOR OBJECT name WAS
SPECIFIED AS qualifier1 but qualifier2 IS
REQUIRED
Explanation: The schema qualifier for the DB2 object
must be qualifier2. The statement defines a new object
named name with an explicit schema qualifier of
qualifier1. Specifying a schema qualifier other than
qualifier2 is not allowed.
System action: The statement was not executed.
Programmer response: Change the statement in one of
the following ways:
v Change the schema qualifier to qualifier2.
v Remove the schema qualifier, and let DB2 default it
to qualifier2.
SQLSTATE: 428EK

Error: DB2 SQL Error: SQLCODE=-084, SQLSTATE=42612, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
UNACCEPTABLE SQL STATEMENT
Explanation: This SQL statement is unacceptable to
DB2. One of the following has occurred:
v An attempt has been made to PREPARE or
EXECUTE IMMEDIATE an SQL statement that
cannot be prepared; refer to the proper SQL
statement in SQL Reference.
v The embedded SQL statement is not an SQL
statement supported by DB2.
v The statement referenced an undeclared cursor.
v An attempt was made to prepare an ALLOCATE
CURSOR statement but the statement identifier is
already associated with a declared cursor.
System action: The statement cannot be executed.
Programmer response: If the situation involves an
SQL statement that cannot be prepared, the problem is
in the source of the SQL statement, not the application
program. Thus, no action is necessary unless the source
of the SQL statement is the application program itself.
If the situation involves an SQL statement that is not
supported by DB2, remove it from the application
program and precompile again.
If the situation involves an invalid PREPARE of an
ALLOCATE CURSOR statement, change the application
program to use a statement identifier that is not
associated with a declared cursor.
Routing code: 42612

Error: DB2 SQL Error: SQLCODE=-087, SQLSTATE=22004, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
A NULL VALUE WAS SPECIFIED IN A
CONTEXT WHERE A NULL IS NOT
ALLOWED
Explanation: An SQL parameter or SQL variable
having a null value was specified in a context in which
a null value is not allowed. For example, an SQL
statement can be specified with an SQL parameter or
SQL variable on the PREPARE and EXECUTE
statements. In these contexts the value of an SQL
parameter or SQL variable must not be null.
System action: The statement cannot be executed.
User response: Correct the SQL statement. For more
information, see SQL Reference.
SQLSTATE: 22004

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