DB2 SQL Errors Codes and Error Messages and Warnings from Error -603 to -607

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-603, SQLSTATE=23515, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
A UNIQUE INDEX CANNOT BE
CREATED BECAUSE THE TABLE
CONTAINS ROWS WHICH ARE
DUPLICATES WITH RESPECT TO THE
VALUES OF THE IDENTIFIED
COLUMNS
Explanation: The index defined in the CREATE
INDEX statement could not be created as unique
because the specified table already contains rows that
are duplicates with respect to the values of the
identified columns.
System action: The statement cannot be executed.
Programmer response: Examine the data to ascertain
whether or not the duplicate data is valid.
Alternatively, consider creating a nonunique index.
SQLSTATE: 23515

Error: DB2 SQL Error: SQLCODE=-604, SQLSTATE=42611, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
A DATA TYPE DEFINITION SPECIFIES
AN INVALID LENGTH, PRECISION,
OR SCALE ATTRIBUTE
Explanation: A data type definition in a CREATE or
ALTER statement contains an invalid length, precision,
or scale attribute specification. In addition, the
specification of data type might be incorrect or invalid.
Or, the column definition in a view referenced in a
CREATE TABLE LIKE view has an invalid length.
System action: The statement cannot be executed. The
specified object was not created or altered.
Programmer response: Correct the syntax, and
resubmit the statement. Refer to chapter 2 of SQL
Reference for information about valid length, precision,
and scale attributes for the data type of an object.
SQLSTATE: 42611

Error: DB2 SQL Error: SQLCODE=-607, SQLSTATE=42832, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
OPERATION OR OPTION operation IS
NOT DEFINED FOR THIS OBJECT
Explanation:
The operation or option cannot be performed on the
object specified in the SQL statement. For example, you
cannot set LOGGED or NOT LOGGED when you
create or alter a table space in the DB2 catalog
(DSNDB06) database, and you cannot clone catalog and
directory objects.
System action: The statement cannot be executed.
Programmer response: If an option of the SQL
statement is not allowed for this object, modify the SQL
statement and resubmit the statement. If an operation is
not defined for the object, the statement cannot be
executed.
SQLSTATE: 42832
Above are list of DB2 SQL Errors and Warnings from Error -603 to -607 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 *