DB2 SQL Errors Codes and Error Messages and Warnings from Error -332 to -336

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-332, SQLSTATE=57017, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
CHARACTER CONVERSION
BETWEEN CCSID from-ccsid TO to-ccsid
REQUESTED BY reason-code IS NOT
SUPPORTED
Explanation: The operation required a conversion
between two different CCSIDs, but no conversion
support was found.
This error may occur if one CCSID is 65535 (BIT data)
and the other CCSID is a graphic CCSID. Conversion is
not defined between 65535 and a graphic CCSID.
from-ccsid
Identifies the coded character set of the string
to be converted.
to-ccsid Identifies the coded character set to which it
must be converted.
reason code
Describes the reason codes returned from DB2.
Reason codes returned from DB2 begin with
‘DSN’ and identify the context in which the
conversion was requested. Values other than
those that start with ‘DSN’ are returned from
other DB2 platforms and are described in the
documentation for the platform.
System action: The statement cannot be processed.
Programmer response: If the conversion request is
correct, refer to the section entitled “Character
conversion” in Installation Guide for information on how
to add conversion support.
SQLSTATE: 57017

Error: DB2 SQL Error: SQLCODE=-333, SQLSTATE=56010, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE SUBTYPE OF A STRING
VARIABLE IS NOT THE SAME AS
THE SUBTYPE KNOWN AT BIND
TIME AND THE DIFFERENCE
CANNOT BE RESOLVED BY
CHARACTER CONVERSION
Explanation: The CCSID in the run time SQLDA is
inconsistent with the bind time subtype of the host
variable or parameter marker. Either the run time
description is BIT and the bind time description was
not BIT, or the run time description is not BIT and the
bind time description was BIT.
System action: The statement cannot be executed.
Programmer response: Change the CCSID in the
SQLDA so that the subtype of the host variable is
consistent with the bind time subtype of the host
variable or parameter marker. If the input data in error
is a parameter marker, you can use the DESCRIBE
INPUT SQL statement to determine the expected
SQLTYPE, SQLLEN and CCSID expected. Refer to
chapter 2 of SQL Reference for more information on
coded character set.
SQLSTATE: 56010

Error: DB2 SQL Error: SQLCODE=-336, SQLSTATE=428FA, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE SCALE OF THE DECIMAL
NUMBER MUST BE ZERO
Explanation: The decimal number is used in a context
where the scale must be zero. This can occur when a
decimal number is specified in a CREATE or ALTER
SEQUENCE statement for START WITH, INCREMENT
BY, MINVALUE, MAXVALUE, or RESTART WITH.
Programmer response: Change the decimal number so
that there are no non-zero digits to the right of the
decimal point.
SQLSTATE: 428FA

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