DB2 SQL Errors Codes and Error Messages and Warnings from Error -327 to -331

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-327, SQLSTATE=22525, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE ROW CANNOT BE INSERTED
BECAUSE IT IS OUTSIDE THE
BOUND OF THE PARTITION RANGE
FOR THE LAST PARTITION
Explanation: When a row is inserted, the calculated
partition key value for the new row must be within the
bounds of a partition (as specified in the VALUES
clause of the CREATE INDEX statement).
System action: The statement cannot be executed.
Programmer response: Correct the statement to
specify a value for the partition key that is within the
bounds of the last partition of the partitioned table
space.
SQLSTATE: 22525

Error: DB2 SQL Error: SQLCODE=-330, SQLSTATE=22021, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
A STRING CANNOT BE USED
BECAUSE IT CANNOT BE
PROCESSED. REASON reason-code,
CHARACTER code-point, HOST
VARIABLE position-number
Explanation: AN error occurred during the processing
of a string, or in the conversion of a string. The type of
error is indicated by the reason-code:
8 Length exception (for example, expansion
required for PC MIXED data exceeds the
maximum length of the string).
12 Invalid code point (for example, use of the
ERRORBYTE option of SYSSTRINGS).
16 Form exception (for example, invalid MIXED
data).
20 Conversion procedure error (for example, an
exit set the length control field of the string to
an invalid value).
24 SBCS character found in string contained in a
wchar_t or sqldbchar host variable.
If the reason-code is 12, code-point is the invalid code
point. Otherwise, code-point is either blank or an
additional reason-code returned by an exit.
If the string is the value of an input host variable, the
position-number is the ordinality of the variable in the
SQLDA. If the string is not the value of a host variable,
the position-number is blank.
System action: The statement cannot be executed.
Programmer response: Take one of the following
actions based on the reason-code:
8 Extend the maximum length of the host
variable to allow for the expansion that occurs
when the string is converted.
12 Change the convert table to accept the
code-point or the data to eliminate the
code-point.
16 If the string is described as MIXED data,
change its description or change the string to
conform to the rules for well-formed mixed
data.
20 Correct the conversion procedure.
24 Delete the SBCS character from the graphic
string.
SQLSTATE: 22021

Error: DB2 SQL Error: SQLCODE=-331, SQLSTATE=22021, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
CHARACTER CONVERSION
CANNOT BE PERFORMED BECAUSE
A STRING, POSITION position-number,
CANNOT BE CONVERTED FROM
source-ccsid TO target-ccsid, REASON
reason-code
SQLSTATE: 22021

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