DB2 SQL Errors Codes and Error Messages and Warnings from Error -594 to -602

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-594, SQLSTATE=42831, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
ATTEMPT TO CREATE A NULLABLE
ROWID OR DISTINCT TYPE
COLUMN column-name
Explanation: A CREATE VIEW statement attempted to
create a new view with a nullable ROWID column.
ROWID columns (or distinct type columns for which
the source type is a ROWID) do not support null
values. One of the following situations has occurred:
v The subselect of a CREATE VIEW statement involves
an outer join for which a column of the result table is
a ROWID column that needs to allow for null values.
System action: The statement cannot be executed.
Programmer response: Change the content of the
statement so that it does not try to create a ROWID
column which must allow for null values.
SQLSTATE: 42831
Error: DB2 SQL Error: SQLCODE=-601, SQLSTATE=42710, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE NAME (VERSION OR VOLUME
SERIAL NUMBER) OF THE OBJECT
TO BE DEFINED OR THE TARGET OF
A RENAME STATEMENT IS
IDENTICAL TO THE EXISTING NAME
(VERSION OR VOLUME SERIAL
NUMBER) object-name OF THE OBJECT
TYPE object-type
Explanation: An attempt to name an object failed
because the name is already in use for an object of the
same type.
object-name
The name of the object.
object-type
The type of object.
The specific cause of this error is indicated by the
object-type value.
object-type=
If the error was encountered for a particular
version of a native SQL procedure, the name
token might return the following information:
name-of-procedure VERSION version-id.
object-type=
Procedure SYSPROC.XSR_REGISTER was
invoked with name that already exists in the
XML schema repository. The procedure
attempted to add new values of XSR
SCHEMA and JAR to the possible values for
the object-type token.
object-type=
A RENAME statement specified a target name
name, but an object with the same name is
already defined in the DB2 subsystem.
object-type=CONSTRAINT
The object name was specified in the
FOREIGN KEY clause, CHECK clause,
PRIMARY KEY clause, or UNIQUE clause of
either a CREATE or ALTER TABLE statement.
All referential integrity, check constraint,
primary key, and unique key constraint names
defined on a table must be unique.
object-type=DISTINCT TYPE
A CREATE DISTINCT TYPE statement failed.
A user-defined type already exists with the
same name as the distinct type name specified
in the CREATE DISTINCT TYPE statement.
object-type=FUNCTION
A CREATE FUNCTION or CREATE
DISTINCT TYPE statement failed. A routine
already exists with the same name as the
name specified in the CREATE statement.
object-type=JAR
An invocation of procedure
SQLJ.INSTALL_JAR failed. A JAR already
exists with the same name as the name
specified on the invocation of procedure
SQLJ.INSTALL_JAR.
object-type=PROCEDURE
A CREATE PROCEDURE statement failed. A
routine already exists with the same name as
the name specified in the CREATE
PROCEDURE statement. If the CREATE
PROCEDURE statement for an SQL procedure
failed, then an SQL procedure might already
with the same name as the external name that
was implicitly or explicitly specified.
object-type=ROLE
A CREATE ROLE statement failed. A role
already exists with the same name as the
name specified in the CREATE ROLE
statement.
object-type=SEQUENCE
ACREATE SEQUENCE statement failed. A a
sequence already exists with the same name as
the sequence name that was specified in the
CREATE SEQUENCE statement.
object-type=TABLE
A CREATE ALIAS statement failed. The alias
name specified in the CREATE ALIAS
statement is identical to the table name or
view name specified. The table might not exist
in the DB2 subsystem.
object-type=TRUSTED CONTEXT
A CREATE TRUSTED CONTEXT statement
failed. A trusted context already exists with the
same name as the name specified in the
CREATE TRUSTED CONTEXT statement.
object-type=VIEW
A CREATE ALIAS statement failed. The alias
name specified in the CREATE ALIAS
statement is identical to the table name or
view name specified. The view might not exist
in the DB2 subsystem.
object-type=VERSION
An ALTER statement attempted to define a
new version of a routine and specified a
version identifier that already exists for the
specified routine.
object-type=VOLUME
An ALTER statement attempted to add a
volume name to a storage group, but a
volume with volume serial number already
exists for the storage group.
object-type=XSR SCHEMA
An invocation of procedure
SYSPROC.XSR_REGISTER failed. An XSR
XML schema already exists with the same
name as the name specified on the invocation
of procedure SYSPROC.XSR_REGISTER.
System action: The CREATE, ALTER or RENAME
statement cannot be executed. No new object was
created, no existing object was altered, and no existing
object was renamed.
Programmer response: Either drop or remove the
existing object or choose another name.
If object-type is data set, do an IDCAMS DELETE of the
data set before retrying the CREATE statement. Refer to
SQL Reference for information about the scope of object
names in DB2.
SQLSTATE: 42710
Error: DB2 SQL Error: SQLCODE=-602, SQLSTATE=54008, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
TOO MANY COLUMNS OR
KEY-EXPRESSIONS SPECIFIED IN A
CREATE INDEX OR ALTER INDEX
STATEMENT
Explanation: The number of columns or
key-expressions specified in the CREATE INDEX or
ALTER INDEX statement exceeds 64, which is the
maximum that is permitted by DB2.
System action: The statement cannot be executed. The
specified index was not created.
Programmer response: The index definition must be
modified to conform to the system-imposed column or
key-expression limit of 64.
SQLSTATE: 54008

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