DB2 SQL Errors Codes and Error Messages and Warnings from Error -590 to -593

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-590, SQLSTATE=42734, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
NAME name IS NOT UNIQUE IN THE
CREATE OR ALTER FOR ROUTINE
routine-name
Explanation: The name specified on a CREATE or
ALTER statement for routine-name is not unique. The
name was specified for a parameter, SQL variable,
cursor, label, or condition, but the name is not unique.
The value for name must adhere to the following rules:
v A parameter name must be unique within the
parameter list.
v An SQL variable name must be unique within the
compound statement in which it is declared,
excluding any declarations within compound
statements that are nested within the compound
statement that declares the SQL variable.
v An SQL variable name must not be the same as a
parameter name.
v A cursor name must be unique within the procedure
body in which it is declared, excluding any
declaration within compound statements that are
nested within the compound statement that declares
the cursor.
v A condition name must be unique within the
compound statement in which it is declared,
excluding any declarations within compound
statements that are nested within the compound
statement that declares the condition.
v A label must be unique within a compound
statement, including any labels within compound
statements that are nested within the compound
statement that defines the label.
System action: The statement cannot be processed.
Programmer response: Change the name so that it is
unique.
SQLSTATE: 42734

Error: DB2 SQL Error: SQLCODE=-592, SQLSTATE=42510, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
NOT AUTHORIZED TO CREATE
FUNCTIONS OR PROCEDURES IN
WLM ENVIRONMENT env-name
Explanation: This message is issued when the check
for authorization to the WLM application environment
in env-name token failed.
System action: The statement cannot be executed.
Programmer response: To correct the error, choose a
different value for the WLM ENVIRONMENT keyword
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.
or request authorization to create objects in the
specified WLM ENVIRONMENT from the system
administrator. Then, reissue the SQL statement.
SQLSTATE: 42510
Error: DB2 SQL Error: SQLCODE=-593, SQLSTATE=42831, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
NOT NULL MUST BE SPECIFIED FOR
ROWID (OR DISTINCT TYPE FOR
ROWID) OR ROW CHANGE
TIMESTAMP COLUMN column-name
Explanation: ROWID columns and distinct type
columns for which the source type is a ROWID, as well
as row change timestamp columns, do not support null
values. When a ROWID column (or distinct type for
which the source type is a ROWID) is defined on a
CREATE TABLE, ALTER TABLE, or DECLARE TABLE
statement, the NOT NULL clause must be specified for
the column. When a row change timestamp column is
defined on a CREATE TABLE or ALTER TABLE
statement, the NOT NULL clause must be specified for
the column.
System action: The statement cannot be executed.
Programmer response: Change the statement to
specify NOT NULL for the column column-name.
SQLSTATE: 42831

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