DB2 SQL Errors Codes and Error Messages and Warnings from Error -392 to -396

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-392, SQLSTATE=42855, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
SQLDA PROVIDED FOR CURSOR
cursor-name HAS BEEN CHANGED
FROM THE PREVIOUS FETCH
Explanation: The application is running with DB2
rules, and has requested that LOB data be returned as a
LOB in one FETCH statement, and as a locator in
another FETCH statement. This request is not
permitted.
cursor-name
The name of the cursor.
System action: The statement is not processed, and
the connection is terminated.
Programmer response: Either do not use DB2 rules, or
modify the application so that it does not change the
data type code from LOB to locator (or the reverse) in
the SQLDA between successive fetches.
SQLSTATE: 42855

Error: DB2 SQL Error: SQLCODE=-393, SQLSTATE=35000, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE CONDITION OR CONNECTION
NUMBER IS INVALID
Explanation: The value of the CONDITION or
CONNECTION number that was specified in the GET
DIAGNOSTICS statement is either less than zero, or
greater than the number of available diagnostics.
System action: The statement cannot be processed.
Programmer response: Correct the value of the
CONDITION or CONNECTION number, while
ensuring that the number is between 1 and the value of
the NUMBER statement-information item or GET
DIAGNOSTICS. Resubmit the GET DIAGNOSTICS
CONDITION or GET DIAGNOSTICS CONNECTION
statement.
SQLSTATE: 35000

Error: DB2 SQL Error: SQLCODE=-396, SQLSTATE=38505, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
object-type object-name ATTEMPTED TO
EXECUTE AN SQL STATEMENT
DURING FINAL CALL PROCESSING
Explanation: A user-defined function named
object-name was invoked and attempted to execute an
SQL statement (other than CLOSE CURSOR) during
final call processing, but the statement is not allowed.
System action: The SQL statement cannot be executed.
Programmer response: Change the definition of the
function to not issue SQL statements during final call
processing.
SQLSTATE: 38505

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