DB2 SQL Errors Codes and Error Messages and Warnings from Error -228 to -240
Error: DB2 SQL Error: SQLCODE=-228, SQLSTATE=42620, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
FOR UPDATE CLAUSE SPECIFIED
FOR READ-ONLY CURSOR cursor-name
Explanation: A cursor was declared read-only with
the INSENSITIVE SCROLL option, but the SELECT
statement contained a FOR UPDATE clause.
Name of the cursor used for the FETCH.
System action: The statement cannot be processed.
Programmer response: To define a scrollable cursor
that is read-only, specify INSENSITIVE SCROLL, but
do not specify FOR UPDATE clause. To define a
scrollable cursor that can be updated, specify
SENSITIVE SCROLL. Correct the application program
to DECLARE CURSOR appropriately.
Error: DB2 SQL Error: SQLCODE=-229, SQLSTATE=42708, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE LOCALE locale SPECIFIED IN A
SET LC_CTYPE OR OTHER
STATEMENT THAT IS LOCALE
SENSITIVE WAS NOT FOUND
Error: DB2 SQL Error: SQLCODE=-240, SQLSTATE=428B4, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE PARTITION CLAUSE OF A LOCK
TABLE STATEMENT IS INVALID
Explanation: The LOCK TABLE statement is invalid
for one of the following reasons:
v If it is partitioned, specify a PARTITION clause that
identifies the partition you want to lock.
System action: The LOCK TABLE statement cannot be
Programmer response: Determine whether the
specified table resides in a partitioned table space
defined with LOCKPART YES.
v If it is partitioned and defined with LOCKPART YES,
specify a PART clause that identifies the partition
you want to lock.
v If it is partitioned but does not have the LOCKPART
YES attribute and you want to lock a single partition,
use ALTER TABLESPACE to change the LOCKPART
attribute to YES.
v If it is not partitioned, do not specify the PART
Above are list of DB2 SQL Errors and Warnings from Error -228 to -240 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.
Information about DB2 SQL Error Codes and Error Messages on Windows, Linux and Z/OS Operating Systems.