DB2 SQL Errors Codes and Error Messages and Warnings from Error -189 to -191

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-189, SQLSTATE=22522, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
CCSID ccsid IS INVALID
Explanation: To determine the subtype of an input
host variable or result column, the SYSSTRINGS
catalog table was accessed with the specified CCSID
and:
v The CCSID is not a value of either INCCSID or
OUTCCSID, or
v The TRANSTYPE column classifies the CCSID as
GRAPHIC rather than CHARACTER, or
v A graphic CCSID has not been specified on your
system.
SQLSTATE: 22522

Error: DB2 SQL Error: SQLCODE=-190, SQLSTATE=42837, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE ATTRIBUTES SPECIFIED FOR
THE COLUMN table-name.column-name
ARE NOT COMPATIBLE WITH THE
EXISTING COLUMN DEFINITION
Explanation: The attributes for the column
column-name of the table table-name in an ALTER TABLE
statement are not compatible with the attributes of the
existing column. The error was returned for one of the
following reasons:
v If a SET DATA TYPE clause is specified, the existing
column is not compatible with the new data type
that was specified, or is of a data type that cannot be
changed. The ALTER TABLE ALTER COLUMN SET
DATA TYPE statement only allows changing
columns of data type character, numeric, or binary.
v If a RESTART, SET GENERATED, SET INCREMENT
BY, SET MINVALUE, SET NO MINVALUE, SET
MAXVALUE, SET NO MAXVALUE, SET CYCLE,
SET NO CYCLE, SET CACHE, SET NO CACHE, SET
ORDER, or SET NO ORDER clause is specified, the
existing column is not defined as an identity column.
These clauses can only be specified for a column that
is defined as an identity column.
v If a SET DEFAULT or DROP DEFAULT clause is
specified, the existing column does not have a
defined default value, or the column has NOT NULL
as the null attribute.
v If a SET DEFAULT or DROP DEFAULT clause is
specified, the existing column is defined as an
identity column, ROWID, or row change timestamp
column.
System action: The statement cannot be executed.
Programmer response: Make the attributes that are
specified in the statement compatible with the existing
column definition, remove the attribute specification, or
specify a different column name.
SQLSTATE: 42837

Error: DB2 SQL Error: SQLCODE=-191, SQLSTATE=22504, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
A STRING CANNOT BE USED
BECAUSE IT IS INVALID MIXED
DATA
Explanation: The operation required the conversion of
a mixed data character string to a different coded
character set. The string could not be converted
because it does not conform to the rules for
well-formed mixed data. For example, the string
contains EBCDIC shift codes that are not properly
paired.
System action: The statement cannot be executed.
Programmer response: If the string contains the
intended information, the description of the column or
host variable should be changed from MIXED DATA to
BIT or SBCS DATA. If the description of the column or
host variable is correct, the string is the problem and it
must be changed to conform to the rules for
well-formed mixed data. For more information about
well-formed MIXED DATA refer to chapter 2 of SQL
Reference .
SQLSTATE: 22504

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