DB2 SQL Errors Codes and Error Messages and Warnings from Error -356 to -372

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-356, SQLSTATE=429BX, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
KEY EXPRESSION key-expr-num IS NOT
VALID, REASON CODE = reason-code
Explanation: The CREATE INDEX statement cannot
be executed because key expression number
key-expr-num is not valid for one of the following
possible reason codes: has one of the following
problems:
1 Contains a subquery
2 Does not contain at least one reference to a
column
3 References a special register
4 Includes a CASE expression
5 Includes a user-defined function
6 Appears more than once in the index
7 References a qualified column name
8 References a column that is defined with a
FIELDPROC
9 References the LOWER or UPPER function
without a locale name or the input
string-expression is FOR BIT DATA
10 References the TRANSLATE function without
an output translation table
11 The CCSID encoding scheme of the result of a
key-expression is different than the CCSID
encoding scheme of the table
System action: The statement cannot be executed.
Programmer response: Correct the error in the key
expression.
SQLSTATE: 429BX

Error: DB2 SQL Error: SQLCODE=-359, SQLSTATE=23522, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE RANGE OF VALUES FOR THE
IDENTITY COLUMN OR SEQUENCE
IS EXHAUSTED
Explanation: DB2 attempted to generate a value for an
identity column or a sequence object. However, all
allowable values have already been assigned.
System action: The statement cannot be processed.
Programmer response: Take one of the following
actions:
v For an identity column, redefine the table with a
larger range of values for the identity column. If a
MAXVALUE or MINVALUE specification has been
made that limits the range of values to be less than
the range for the data type of the column, then the
column can be altered to expand the range of valid
values. Otherwise, the identity column must be
recreated, which requires that the table be recreated.
First, drop the existing table; then, recreate the table
with a different data type for the identity column,
specifying a data type that has a larger range of
values than the current data type for the identity
column.
v For a sequence object, redefine the sequence with a
larger range of values. If a MAXVALUE or
MINVALUE specification has been made that limits
the range of values to be less than the range for the
data type, then the sequence can be altered to
expand the range of valid values. Otherwise, the
sequence must be recreated using DROP SEQUENCE
and CREATE SEQUENCE to cover a larger range of
values.
SQLSTATE: 23522

Error: DB2 SQL Error: SQLCODE=-372, SQLSTATE=428C1, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
ONLY ONE ROWID, IDENTITY, OR
SECURITY LABEL COLUMN IS
ALLOWED IN A TABLE
Explanation: One of the following actions was
attempted:
v Create a table with more than one ROWID column.
v Add a ROWID column to a table that already has
one.
v Create a table with more than one identity column.
v Add an identity column to a table that already has
one.
v Add a security label column to a table that already
has one.
v Create a table with more than one security label
column.
v Create a table without a security label in the
Common Criteria environment which requires a
security label column on every table created.
System action: The statement was not processed.
Programmer response: For a CREATE TABLE
statement, select only one column to have the row ID
data type, the AS IDENTITY attribute, or the As
SECURITY LABEL attribute. For an ALTER TABLE
statement, a ROWID column, identity column, or
security label column already exists for the table. Do
not attempt to add another column with the data type
row ID, with the AS IDENTITY attribute or the AS
SECURITY LABEL to the table.
If the Common Criteria environment is set (DSN6SPRM
COMCRIT= YES), then every table created must have a
security label. Designate a column AS SECURITY
LABEL or change the subsystem parameter.
SQLSTATE: 428C1

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