DB2 SQL Errors Codes and Error Messages and Warnings from Error -096 to -101

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-096, SQLSTATE=42704, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
VARIABLE variable-name DOES NOT
EXIST OR IS NOT SUPPORTED BY
THE SERVER AND A DEFAULT
VALUE WAS NOT PROVIDED
Explanation: The GETVARIABLE function was
invoked for variable variable-name. However, a value
does not exist for a variable with that name, and a
default value was not provided.
v If the qualifier is SESSION, a user-defined variable
with name variable-name has not been set.
v If the qualifier is SYSIBM, the server does not
support a built-in session variable with name
variable-name.
System action: The statement cannot be executed.
Programmer response: Change the invocation of the
function to specify a default variable for variable-name,
or change the name of a variable that does exist.
SQLSTATE: 42704

Error: DB2 SQL Error: SQLCODE=-097, SQLSTATE=42601, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE USE OF LONG VARCHAR OR
LONG VARGRAPHIC IS NOT
ALLOWED IN THIS CONTEXT
Explanation: The statement attempted to use the
LONG VARCHAR or LONG VARGRAPHIC syntax.
This syntax cannot be used for the following
statements:
v CAST specification syntax
v CREATE DISTINCT TYPE
v CREATE FUNCTION
v CREATE PROCEDURE
v ALTER FUNCTION
v COMMENT ON FUNCTION
v GRANT EXECUTE ON FUNCTION
v REVOKE EXECUTE ON FUNCTION
v DROP
Use the VARCHAR or VARGRAPHIC syntax specifying
an explicit length as required.
System action: The statement cannot be executed.
Programmer response: Correct the statement.
SQLSTATE: 42601

Error: DB2 SQL Error: SQLCODE=-101, SQLSTATE=54001, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE STATEMENT IS TOO LONG OR
TOO COMPLEX
Explanation: DB2 cannot process the statement
because it exceeds the system limits for length or
complexity. Enabling parallelism will increase the
complexity of the statement.
System action: DB2 cannot process the statement.
Programmer response: Divide the statement into
shorter or less complex SQL statements.
If the statement enables parallelism, try disabling
parallelism. You may do this by using the DEGREE(1)
bind option for static SQL, or by setting the CURRENT
DEGREE special register to ‘1’ for dynamic SQL.
SQLSTATE: 54001

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