DB2 SQL Errors Codes and Error Messages and Warnings from Error +220 to +236

SQLServerF1

Error: DB2 SQL Error: SQLCODE=+220, SQLSTATE=01546, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE COLUMN column-name IN
EXPLANATION TABLE table-name IS
NOT DEFINED PROPERLY
Explanation: An error occurred during the insertion of
a row into the explanation table. The table is
improperly defined for the following reasons:
v A column is missing.
v Columns are defined in the wrong order.
v The table contains an extra column.
v A column description is invalid because of its name,
data type, length, or null attributes.
System action: A valid plan or package will be
created if no errors are detected. The statement is
bound dynamically on each execution of the statement.
Programmer response: For better performance, rebind
the plan or package after correcting the statement. To
correct the statement, correct the definition of the
required explanation table. Refer to chapter 2 of SQL
Reference for information about defining an explanation
table.
SQLSTATE: 01546

Error: DB2 SQL Error: SQLCODE=+222, SQLSTATE=02502, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
HOLE DETECTED USING CURSOR
cursor-name
Explanation: A delete hole or an update hole has been
detected while processing a FETCH for cursor
cursor-name. With a SENSITIVE STATIC cursor, a delete
hole occurs when DB2 tries to refetch a row from the
database for a cursor and finds that the corresponding
row of the underlying table has been deleted. An
update hole occurs when DB2 tries to refetch a row
from the database for a cursor and finds that the
corresponding row of the underlying table no longer
satisfies the search condition.
cursor-name
Name of the cursor used for the FETCH
statement.
System action: The statement cannot be processed,
and no data is fetched. The cursor is repositioned on
the hole.
Programmer response: Correct the application
program to handle this situation, or change isolation
levels so the base row cannot be deleted during the
cursor operation.
SQLSTATE: 02502

Error: DB2 SQL Error: SQLCODE=+231, SQLSTATE=02000, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
CURRENT POSITION OF CURSOR
cursor-name IS NOT VALID FOR THE
SPECIFIED FETCH ORIENTATION OF
THE CURRENT ROW OR ROWSET
Explanation: The cursor was not positioned on a row
or rowset, and one of the following fetch orientations
specified that the cursor was to be positioned relative
to its current position:
v CURRENT or CURRENT ROWSET
v RELATIVE 0 or ROWSET STARTING AT RELATIVE
0
cursor-name
Name of the cursor used for the FETCH
statement.
System action: The statement cannot be processed. No
data was fetched, and the cursor position is unchanged.
Programmer response: Correct the application
program to establish a valid cursor position before
issuing this FETCH statement.
SQLSTATE: 02000

Error: DB2 SQL Error: SQLCODE=+236, SQLSTATE=01005, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
SQLDA INCLUDES integer1 SQLVAR
ENTRIES, BUT integer2 ARE
REQUIRED FOR integer3 COLUMNS
Explanation: The value of the SQLN field of the
SQLDA should be at least as large as the number of
columns being described. integer3 is the number of
columns being described.
In the case that USING BOTH has been specified, twice
as many SQLVAR entries are needed as the number of
columns being described.
The number of SQLVAR entries that are needed to
return all of the information about the columns is
integer2.
Attention: In the case of DESCRIBE INPUT, each
reference to column would actually be parameter.
System action: The SQLDAID 7th byte has been set to
“on” with a value of 2 indicating that 2 SQLVAR entries
are needed for each column. DB2 has not set any
SQLVAR entries.
Programmer response: Increase the value of the SQLN
field in the SQLDA to the value indicated in the
message (making sure the SQLDA is large enough to
support that amount) and resubmit the statement.
SQLSTATE: 01005

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