DB2 SQL Errors Codes and Error Messages and Warnings from Error -242 to -244

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-242, SQLSTATE=42713, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE OBJECT NAMED object-name OF
TYPE object-type WAS SPECIFIED
MORE THAN ONCE IN THE LIST OF
OBJECTS, OR THE NAME IS THE
SAME AS AN EXISTING OBJECT
Explanation: In a list of object names of type
object-type, the object named object-name was specified
more than once, or is the same as an existing name of
that type.
System action: The statement cannot be processed.
User response: Correct the error by removing all of
the duplicate occurrences of the object from the list.
SQLSTATE: 42713

Error: DB2 SQL Error: SQLCODE=-243, SQLSTATE=36001, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
SENSITIVE CURSOR cursor-name
CANNOT BE DEFINED FOR THE
SPECIFIED SELECT STATEMENT
Explanation: The cursor cursor-name is defined as
SENSITIVE, but the content of the SELECT statement
makes the cursor read-only. In most cases the SELECT
statement requires DB2 to build a temporary table or
work file with the result table of the cursor, and DB2
cannot guarantee that changes made outside the cursor
will be visible. In this case, the cursor must be defined
INSENSITIVE or ASENSITIVE.
System action: The statement cannot be processed.
Programmer response: Either change the content of
the query to result in a result table that is not
read-only, or change the type of cursor to be
INSENSITIVE or ASENSITIVE.
SQLSTATE: 36001

Error: DB2 SQL Error: SQLCODE=-244, SQLSTATE=428F4, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
SENSITIVITY sensitivity SPECIFIED ON
THE FETCH IS NOT VALID FOR
CURSOR cursor-name
Explanation: The sensitivity option specified on
FETCH conflicts with the sensitivity option in effect for
cursor cursor-name. If a cursor is declared
INSENSITIVE, the FETCH statement can only specify
INSENSITIVE or nothing. If a cursor is declared
SENSITIVE, the FETCH statement can specify
INSENSITIVE, SENSITIVE, or nothing.
The keyword INSENSITIVE is not allowed with the
FETCH statements if the associated cursor is either:
v Declared as SENSITIVE DYNAMIC SCROLL, or
v The cursor is declared ASENSITIVE, and DB2
selected the maximum allowable sensitivity of
SENSITIVE DYNAMIC SCROLL for the associated
SELECT statement.
In the case of a non-scrollable cursor, the sensitivity
option cannot be specified.
sensitivity
Specified sensitivity for the FETCH statement.
cursor-name
Name of the cursor used for the FETCH
statement.
System action: The statement cannot be processed.
Programmer response: Change or remove the
sensitivity option that is specified on the FETCH.
SQLSTATE: 428F4

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