DB2 SQL Errors Codes and Error Messages and Warnings from Error +20141 to +20237

SQLServerF1

Error: DB2 SQL Error: SQLCODE=+20141, SQLSTATE=01004, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
TRUNCATION OF VALUE WITH
LENGTH length OCCURRED FOR
hv-or-parm-number
Explanation: A value that was assigned to a host
variable or parameter was truncated. However, the
length of the value that was truncated is too large to be
returned in the indicator variable. This situation can
occur when truncation occurs on assignment of:
v a value to a parameter of a remote stored procedure
if the value being truncated is greater than 127 bytes.
In this case, the indicator variable will contain a
value of 127.
v a LOB value to a host variable if the value being
truncated is greater than 32K bytes. In this case, the
indicator variable will contain a value of 32K.
In these cases, the actual length of the truncated value
cannot be returned to the application that uses the
indicator variable. The actual length of the value is
returned as message token length.
System action: The assignment was made, but the
data was truncated.
Programmer response: Change the declaration of
hv-or-parm-number to avoid truncation.
SQLSTATE: 01004

Error: DB2 SQL Error: SQLCODE=+20187, SQLSTATE=01656, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
ROLLBACK TO SAVEPOINT CAUSED
A NOT LOGGED TABLE SPACE TO BE
PLACED IN THE LPL
Explanation: An application issued a ROLLBACK, but
uncommitted changes existed for a table space defined
with the NOT LOGGED logging attribute. DB2 cannot
undo changes made to not logged table spaces because
no log records were written due to the logging attribute
of the table space. The table space is placed in the LPL
so that other concurrently running agents are not able
to see the data that cannot be rolled back. The table
space is also marked recover pending because the table
space has been modified.
System action: The ROLLBACK TO SAVEPOINT was
performed, however changes that were made to not
logged table spaces have not been undone.
Programmer response: Avoid making changes to a not
logged table space within the span of a savepoint to
which you intend to rollback.
To remove a table space from the LPL and reset recover
pending, use one of the following options:
v REFRESH TABLE to repopulate a Materialized Query
Table, but only if the Materialized Query Table is
alone in its table space. If the table, including
Materialized Query Tables, is not alone in its table
space, a utility must be used to reset the table space
and remove it from recover pending.
v RECOVER utility, to recover either to currency or to
a prior image copy
v LOAD REPLACE utility or LOAD REPLACE PART
utility:
– With an input dataset to empty the table space
and repopulate the table
– Without an input dataset to empty the table space
to prepare for one or more insert operations to
repopulate the table
v Drop and recreate the table space and repopulate the
table.
v DELETE without a WHERE clause to empty the
table. When the table space is segmented or
universal, the table is alone in its table space and the
table does not have a VALIDPROC, referential
constraints, delete Triggers, or a SECURITY LABEL
column (or has this column, but multilevel security is
not in effect).
v TRUNCATE TABLE to empty the table. When the
table space is segmented or universal, the table is
alone in its table space and the table does not have a
VALIDPROC, referential constraints, or a SECURITY
LABEL column (or has this column, but multilevel
security with row level granularity is not in effect).
Important: If the table, materialized query table or not,
is not alone in its table space, a utility must be used to
reset the table space and remove it from recover
pending.
SQLSTATE: 01656

Error: DB2 SQL Error: SQLCODE=+20237, SQLSTATE=02504, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
FETCH PRIOR ROWSET FOR CURSOR
cursor-name RETURNED A PARTIAL
ROWSET
Explanation: A FETCH PRIOR ROWSET statement
was issued, but there were not enough rows prior to
the current cursor position to reposition the cursor on a
full rowset. The cursor has been positioned on a partial
rowset. If a target was specified, then data has only
been returned for the number of rows that were
actually fetched for the partial rowset.
System action: The cursor is positioned on a partial
rowset.
Programmer response: Analyze the situation to
determine if anything should be rolled back.
SQLSTATE: 02504

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