DB2 SQL Errors Codes and Error Messages and Warnings from Error -551 to -553

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-551, SQLSTATE=42501, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
auth-id DOES NOT HAVE THE
PRIVILEGE TO PERFORM
OPERATION operation ON OBJECT
object-name
Explanation: Authorization ID auth-id attempted to
perform operation on object object-name without having
been granted the proper authority to do so. This error
might also occur if the object is a read-only view (for
insert, delete, or update data change operation), or if
auth-id is trying to create a table or view with an
authorization ID other than its own.
You can create a table from an auth-id other than your
own only if your authorization ID is SYSADM,
DBADM, or DBCTRL. You can create a view from an
auth-id other than your own only if your authorization
ID is SYSADM.
If you are using a trusted context, the token auth-id
might return a role instead of an authorization ID. A
role is returned if a role was in effect and the
authorization checking is performed against the role,
rather than the authorization ID of the session, when
the condition was encountered. Otherwise an
authorization ID is returned. A role is returned in the
following format as a single token:
v ROLE: role-name
In addition to the situations mentioned previously, this
error can occur for the following situations:
v When operation is GRANT ***, the keyword ALL was
used in the GRANT statement, but the grantor
auth-id does not have any privilege to grant.
v If operation is DROP PACKAGE, the object-name
consists of the collection ID, the package name, and
the consistency token. The consistency token
uniquely identifies the version of the package that
the user does not have authorization to drop.
v If operation is USAGE OF DISTINCT TYPE or USAGE
OF JAR, the object-name identifies, respectively, the
DISTINCT TYPE or JAR for which the auth-id lacks
USAGE privilege.
v If operation is ALTER JAR, the auth-id lacks ALTERIN
privilege on the schema of the JAR object-name.
v If this error occurs while DB2 is creating or altering a
table that involves referential constraints, this error
message reports that the user does not have the
necessary ALTER privilege to perform a FOREIGN
KEY, DROP FOREIGN KEY, DROP PRIMARY KEY,
or DROP UNIQUE operation. The object-name
identifies the object table of the CREATE or ALTER
TABLE statement, not the table for which the user
lacks the ALTER privilege.
v If this error occurs for a distributed SQL request, one
of the following conditions can occur:
– If authorization ID translation is in effect for either
the requesting DB2 site or the serving
(responding) DB2 site, then auth-id is the
translated authorization ID. Refer to Part 3
(Volume 1) of the DB2 Administration Guide for
information on authorization ID translation.
– If an alias name was used in the SQL statement,
the object-name is the resolved remote table name
or view name.
v If this error occurs during invocation of a routine,
the authorization ID auth-id does not have the
EXECUTE privilege on any candidate routine in the
SQL path. The variable for object-name is the name of
a candidate routine in the SQL path.
Note: Beginning with Version 5, SQLCODE -551 is
returned instead of SQLCODE -204 for the run-time
error in which an object does not exist and the
CURRENT RULES special register is set to STD.
System action: The statement cannot be executed.
Programmer response: To correct the error, verify the
following situations:
v The auth-id has the authority to perform the
operation.
v The object-name exists.
v The auth-id is not trying to create a table with a
schema qualifier that is not the same as auth-id.
SQLSTATE: 42501

Error: DB2 SQL Error: SQLCODE=-552, SQLSTATE=42502, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
authorization-id DOES NOT HAVE THE
PRIVILEGE TO PERFORM
OPERATION operation
Explanation: An operation was attempted by an
authorization ID that lacks the required authority.
authorization-id
The authorization ID that attempted to
perform the operation.
If you are using a trusted context, the
authorization-id value might be a role instead of
an authorization ID. A role is returned if a role
was in effect and the authorization checking is
performed against the role, rather than the
authorization ID of the session, when the
condition was encountered. Otherwise an
authorization ID is returned. A role is returned
in the following format as a single token:
ROLE: role-name DOES NOT HAVE THE
PRIVILEGE TO PERFORM OPERATION operation
operation
The operation that was attempted.
System action: The statement cannot be processed.
Administrator response: Check for an attempted
authorization violation.
Programmer response: Ensure that the authorization
ID has been granted the authority necessary to perform
the desired operation.
SQLSTATE: 42502

Error: DB2 SQL Error: SQLCODE=-553, SQLSTATE=42503, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
auth-id SPECIFIED IS NOT ONE OF
THE VALID AUTHORIZATION IDS
FOR REQUESTED OPERATION
Explanation: The statement failed for one of the
following reasons:
v The authorization ID specified as the value of the
authorization-id or host variable in the SQL SET
CURRENT SQLID statement is neither the user’s
primary authorization ID nor one of the associated
secondary authorization IDs.
v The authorization ID specified as the value of the
PACKAGE OWNER option for a CREATE or ALTER
PROCEDURE statement is neither the user’s primary
authorization ID nor one of the associated secondary
authorization IDs.
System action: The statement cannot be processed.
User response: Change the authorization ID to a value
that the user can use.
SQLSTATE: 42503

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

 

DB2 SQL Errors Codes and Error Messages and Warnings from Error -546 to -549

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-546, SQLSTATE=42621, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE CHECK CONSTRAINT
constraint-name IS INVALID
Explanation: A check constraint in the CREATE
TABLE or ALTER TABLE statement is invalid for one
or more of the following reasons:
v The constraint definition refers to a column that has
a field procedure.
v The constraint definition refers to a column with a
data type that is lower in the hierarchy of numeric
data types than the data type
small integer < large integer < decimal
< single precision float
< double precision float
v The constraint definition refers to a column with a
numeric data type that is not the same numeric data
type as that of the other column operands.
v The constraint definition refers to a column with a
length that is shorter than the other operands when
the column and other operands are not character
string data types.
v The constraint definition refers to a built-in or
user-defined function.
v The constraint definition uses a cast function that
requires conversion of the data. The only functions
that are allowed in a check constraint are cast
functions that do not require conversion of the data.
v The constraint contains an XML column
v The constraint definition contains an XMLQuery
expression.
v The constraint definition refers to a DECFLOAT
column.
System action: The statement is not executed.
For ALTER TABLE, the check constraint is not added to
the object table. The definition of the table is
unchanged.
For CREATE TABLE, the table is not created.
Programmer response: Correct the check constraint
definition and execute the statement again.
SQLSTATE: 42621

Error: DB2 SQL Error: SQLCODE=-548, SQLSTATE=42621, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
A CHECK CONSTRAINT THAT IS
DEFINED WITH column-name IS
INVALID
Explanation: A check constraint in the CREATE
TABLE or ALTER TABLE statement is invalid for one
or more of the following reasons:
v The constraint definition refers to a column that has
a field procedure.
v The constraint definition refers to a column with a
data type that is lower in the hierarchy of numeric
data types than the data type of any other operand.
The hierarchy is as follows:
small integer < large integer < big integer
< decimal < single precision float
< double precision float
v The constraint definition refers to a column with a
numeric data type that is not the same numeric data
type as that of the other column operands.
v The constraint definition refers to a column with a
length that is shorter than the other operands when
the column and other operands are not character
string data types.
v The constraint definition refers to a ROWID column.
v The constraint definition refers to a LOB column.
v The constraint contains an XML column.
v The constraint definition contains an XMLQuery
expression.
v The constraint definition refers to a DECFLOAT
column.
v An XMLQUERY or XMLEXISTS argument list
contained two arguments with the same name.
System action: The statement is not executed.
For ALTER TABLE, the check constraint is not added to
the object table. The definition of the table is
unchanged.
For CREATE TABLE, the table is not created.
Programmer response: Correct the check constraint
definition and execute the statement again.
SQLSTATE: 42621

Error: DB2 SQL Error: SQLCODE=-549, SQLSTATE=42509, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE statement STATEMENT IS NOT
ALLOWED FOR object_type1 object_name
BECAUSE THE BIND OPTION
DYNAMICRULES(RUN) IS NOT IN
EFFECT FOR object_type2
Explanation: A program attempted to issue the
indicated SQL statement that is one of several SQL
statements that cannot be issued from a plan or
package for which the option DYNAMICRULES(RUN)
is not in effect. Those SQL statements are:
v Dynamic GRANT statement
v Dynamic REVOKE statement
v Dynamic ALTER statement
v Dynamic CREATE statement
v Dynamic DROP statement
The indicated SQL statement is bound to one of the
following:
v The named plan or package that was not bound with
the option DYNAMICRULES(RUN)
v The named package that was not bound with the
DYNAMICRULES option, but is appended to a plan
that was not bound with DYNAMICRULES(RUN)
statement
The SQL statement in error
object_type1
PACKAGE or DBRM
object_name
If object_type1 is PACKAGE, object_name is the
name of the package in the format
‘location-id.collection-id.package-id’.
If object_type1 is DBRM, object_name is the
name of the DBRM in the format ‘plan-name
DBRM-name’.
object_type2
PLAN or PACKAGE
If object_type1 is PACKAGE, object_type2 can be
either PACKAGE or PLAN (whichever is
bound with a DYNAMICRULES value other
than RUN).
If object_type1 is DBRM, object_type2 is PLAN.
System action: The SQL statement cannot be executed.
Programmer response: Do one of the following to
correct the error:
v If the SQL statement is embedded, remove it,
precompile and compile the application program
again, and reissue the BIND command with the
desired DYNAMICRULES option.
v If appropriate, use the SQL statement with a package
or plan that is bound with DYNAMICRULES(RUN).
v Issue the REBIND command with the
DYNAMICRULES(RUN) option for the plan or
package to which the SQL statement is bound
Refer to the BIND PACKAGE(DSN), BIND
PLAN(DSN), REBIND PACKAGE(DSN), or REBIND
PLAN(DSN) statement in Command Reference for the
description of the DYNAMICRULES option and the
expected results. Determine if either the SQL statement
should be removed from the program or the plan or
package should be rebound with the
DYNAMICRULES(RUN) option.
SQLSTATE: 42509

Above are list of DB2 SQL Errors and Warnings from Error -546 to -549 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 &gt; 0, execution was successful with a warning.
If SQLCODE &lt; 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.

 

DB2 SQL Errors Codes and Error Messages and Warnings from Error -543 to -545

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-543, SQLSTATE=23511, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
A ROW IN A PARENT TABLE
CANNOT BE DELETED BECAUSE THE
CHECK CONSTRAINT check-constraint
RESTRICTS THE DELETION
Explanation: The delete operation cannot be executed
because the target table is a parent table and is
connected with a referential constraint to a dependent
table with a delete rule of SET NULL. However, a
check constraint defined on the dependent table
restricts the column from containing a null value.
System action: The DELETE statement was not
executed. The contents of the tables are unchanged.
Programmer response: Examine the foreign key and
its delete rule in the dependent table and the
conflicting check constraint. Change either the delete
rule or the check constraint so that they do not conflict.
SQLSTATE: 23511

Error: DB2 SQL Error: SQLCODE=-544, SQLSTATE=23512, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE CHECK CONSTRAINT
SPECIFIED IN THE ALTER TABLE
STATEMENT CANNOT BE ADDED
BECAUSE AN EXISTING ROW
VIOLATES THE CHECK
CONSTRAINT
Explanation: An existing row violates the check
constraint specified in the ALTER TABLE statement.
System action: The statement cannot be executed. The
check constraint definition is not added to the table.
The table definition is unchanged.
Programmer response: Examine the check constraint
definition that was specified in the ALTER TABLE
statement and the data in the table to determine why
the ALTER TABLE statement was rejected.
You can determine which rows violated the check
constraint by using the SELECT statement, negating the
check constraint in the WHERE clause. For example:
SELECT * FROM table WHERE (NOT (check-condition));
SQLSTATE: 23512

Error: DB2 SQL Error: SQLCODE=-545, SQLSTATE=23513, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE REQUESTED OPERATION IS
NOT ALLOWED BECAUSE A ROW
DOES NOT SATISFY THE CHECK
CONSTRAINT check-constraint
Explanation:
Check constraint violations occurred on an INSERT,
UPDATE, or MERGE statement. The resulting row
violated the check constraint definition on the table.
System action:
The INSERT, UPDATE, or MERGE statement cannot be
executed. The contents of the table are unchanged.
Programmer response: Examine the data and the
check constraint definition in the SYSIBM.SYSCHECKS
catalog table to determine why the INSERT, MERGE,
DELETE, or UPDATE statement was rejected. The data
must be changed to satisfy the check constraint.
SQLSTATE: 23513

Above are list of DB2 SQL Errors and Warnings from Error -543 to -545 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 &gt; 0, execution was successful with a warning.
If SQLCODE &lt; 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.

 

DB2 SQL Errors Codes and Error Messages and Warnings from Error -539 to -542

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-539, SQLSTATE=42888, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
TABLE table-name DOES NOT HAVE A
PRIMARY KEY
Explanation: DB2 cannot perform the CREATE or
ALTER TABLE statement because the indicated table
does not have a primary key. Thus, the primary key
cannot be dropped, or the table cannot be defined as a
parent in a referential constraint.
System action: The statement cannot be processed.
Programmer response: Correct the statement to
reference a table with a primary key, or define a
primary key with ALTER TABLE ADD PRIMARY KEY
before referencing the table in a FOREIGN KEY clause.
SQLSTATE: 42888

Error: DB2 SQL Error: SQLCODE=-540, SQLSTATE=57001, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE DEFINITION OF TABLE table-name
IS INCOMPLETE BECAUSE IT LACKS
A PRIMARY INDEX OR A REQUIRED
UNIQUE INDEX
Explanation: An attempt was made to use table
table-name in a CREATE or ALTER statement to define a
foreign key or a clone table, or it was referenced in an
SQL manipulative statement. However, the current
status of the table is incomplete, so it cannot be used as
specified. The definition of the table may be incomplete
because the table was defined with a PRIMARY KEY
clause, a UNIQUE clause, or a ROWID column with
the GENERATED BY DEFAULT attribute. The
definition of the table is incomplete, and it cannot be
used until a unique index is defined for:
v the primary key (the primary index)
v a ROWID column
v for each set of columns in any UNIQUE clause (the
required unique indexes).
An attempt was made to use the table in a FOREIGN
KEY clause or in an SQL manipulative statement.
System action: The statement cannot be executed.
Programmer response: Define a primary index or a
required unique index on the table before referencing it.
SQLSTATE: 57001

Error: DB2 SQL Error: SQLCODE=-542, SQLSTATE=42831, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
column-name CANNOT BE A COLUMN
OF A PRIMARY KEY, A UNIQUE
CONSTRAINT, OR A PARENT KEY
BECAUSE IT CAN CONTAIN NULL
VALUES
Explanation: The code is used to report that a column
identified in a PRIMARY KEY, a UNIQUE constraint
clause, or a parent key (via a REFERENCES clause) is
defined to allow null values.
System action: The statement cannot be executed.
Programmer response: In the case of a column
identified in a PRIMARY KEY or a UNIQUE constraint
clause, correct the statement and rerun it.
In the case of a column identified in a REFERENCES
clause, drop the parent table then recreate it with
referenced columns defined as NOT NULL. Afterwards,
rerun the statement.
SQLSTATE: 42831

Above are list of DB2 SQL Errors and Warnings from Error -539 to -542 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 &gt; 0, execution was successful with a warning.
If SQLCODE &lt; 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.

 

DB2 SQL Errors Codes and Error Messages and Warnings from Error -536 to -538

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-536, SQLSTATE=42914, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE DELETE STATEMENT IS
INVALID BECAUSE TABLE table-name
CAN BE AFFECTED BY THE
OPERATION
Explanation: A DELETE operation with the indicated
table referenced in a subquery was attempted.
If ‘T’ is the object table of the DELETE, the indicated
table is one of the following:
v A dependent of ‘T’ in a relationship with a delete
rule of CASCADE or SET NULL
v A dependent of another table in a relationship with a
delete rule of CASCADE or SET NULL in which
deletions from ‘T’ can cascade to that table.
System action: The DELETE statement cannot be
processed. The contents of the object table are
unchanged.
Programmer response: Do not attempt to reference a
table in a subquery of a DELETE statement when the
table can be affected by the DELETE statement.
SQLSTATE: 42914

Error: DB2 SQL Error: SQLCODE=-537, SQLSTATE=42709, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE PRIMARY KEY, FOREIGN KEY,
UNIQUE, OR PARTITIONING KEY
CLAUSE IDENTIFIES COLUMN
column-name MORE THAN ONCE
Explanation: PRIMARY KEY, FOREIGN KEY,
UNIQUE, or PARTITIONING KEY can each be
followed by a list of column names. The statement
violates the rule that no column name can appear more
than once in any such list.
System action: The statement cannot be executed.
Programmer response: Correct the statement to
specify unique names for each column.
SQLSTATE: 42709

Error: DB2 SQL Error: SQLCODE=-538, SQLSTATE=42830, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
FOREIGN KEY name DOES NOT
CONFORM TO THE DESCRIPTION
OF A PARENT KEY OF TABLE
table-name
Explanation: The definition of the indicated foreign
key does not conform to the description of parent key
of the indicated table due to one of the following
reasons:
v The referenced parent key has not been defined as a
primary key or a unique key.
v The keys do not have the same number of columns.
v The description of the keys are not identical. The
requirement for identical descriptions includes data
type, length attribute, and field procedure.
name is the constraint-name specified in the foreign key
clause or, if a constraint-name was not specified, the
first column-name specified in the clause.
System action: The statement cannot be processed.
Programmer response: Correct the statement so that
the description of the foreign key references a primary
key or unique key, or so that the description of the
foreign key conforms to that of a parent key of the
indicated table.
SQLSTATE: 42830

Above are list of DB2 SQL Errors and Warnings from Error -536 to -538 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 &gt; 0, execution was successful with a warning.
If SQLCODE &lt; 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.

 

DB2 SQL Errors Codes and Error Messages and Warnings from Error -532 to -534

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-532, SQLSTATE=23504, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE RELATIONSHIP constraint-name
RESTRICTS THE DELETION OF ROW
WITH RID X rid-number
Explanation: A DELETE operation attempted to delete
a specified parent row in the object table and all related
descendent rows in the descendent tables. However, a
delete rule of RESTRICT or NO ACTION was specified
for one or more descendent tables.
A row of the table cannot be deleted because it has a
dependent in a relationship with a delete rule of
RESTRICT or NO ACTION or the deletion cascades to
a row which is a dependent in a relationship with a
delete rule of RESTRICT or NO ACTION.
If the statement that failed is an ALTER TABLE with
ALTER PART ROTATE FIRST TO LAST, then there is a
referential constraint that is defined with DELETE
RESTRICT on the table, and the data in the partition
that is to be reused cannot be deleted because of the
referential constraint.
System action: The DELETE statement cannot be
executed. The contents of the object table are
unchanged.
Programmer response: Examine the delete rule for all
descendent tables to determine the cause of the
problem. The specific tables involved can be
determined from the relationship constraint-name. The
specific descendent row is known by RID X rid-number.
SQLSTATE: 23504

Error: DB2 SQL Error: SQLCODE=-533, SQLSTATE=21501, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
INVALID MULTIPLE-ROW INSERT
Explanation: An INSERT operation with a subselect
attempted to insert multiple rows into a self-referencing
table.
The subselect of the INSERT operation should return
no more than one row of data.
System action: The INSERT statement cannot be
executed. The contents of the object table are
unchanged.
Programmer response: Examine the search condition
of the subselect to make sure that no more than one
row of data is selected.
SQLSTATE: 21501

Error: DB2 SQL Error: SQLCODE=-534, SQLSTATE=21502, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE PRIMARY KEY CANNOT BE
UPDATED BECAUSE OF
MULTIPLE-ROW UPDATE
Explanation: An UPDATE operation attempted to
update a primary key on multiple rows of the object
table.
An UPDATE statement updating the primary key
cannot be used to update more than one row of the
object table.
Note: This SQLCODE will only be issued for plans and
packages bound prior to Version 5. SQLCODE -534 will
not be issued for dynamic SQL or plans and packages
bound with Version 5 or later releases.
System action: The UPDATE statement cannot be
executed. The contents of the object table are
unchanged.
Programmer response: Examine the search condition
of the UPDATE statement to make sure that no more
than one row of the object table is selected to be
updated.
SQLSTATE: 21502

Above are list of DB2 SQL Errors and Warnings from Error -532 to -534 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 &gt; 0, execution was successful with a warning.
If SQLCODE &lt; 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.

 

DB2 SQL Errors Codes and Error Messages and Warnings from Error -526 to -531

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-526, SQLSTATE=42995, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE REQUESTED OPERATION OR
USAGE DOES NOT APPLY TO
table-type TEMPORARY TABLE
table-name
Explanation: DB2 assumes that the SQL statement
being executed refers to a created or declared temporary
table named table-name, and the requested operation or
usage in the statement is not allowed on the temporary
table.
table-type
CREATED or DECLARED
CREATED is for a temporary table defined by
the CREATE GLOBAL TEMPORARY TABLE
statement.
DECLARED is for a temporary table defined
by the DECLARE GLOBAL TEMPORARY
TABLE statement.
table-name
Qualified name of the temporary table.
System action: The statement cannot be processed.
Programmer response: Modify the SQL statement to
ensure that the object references are not to the indicated
type of temporary table, or if table-type is DECLARED
and you intended table-name to refer to an existing
persistent base table, you must perform one of the
following actions:
v Recreate the persistent base table table-name with a
different schema qualifier
v In the same application process, issue a DROP
TABLE for table name followed by a COMMIT to
drop the declared temporary table and afterwards be
able to reference the persistent base table with the
same table-name in the same application process
v Remove the DECLARE GLOBAL TEMPORARY
TABLE statement from the application process to use
the persistent base table with the same table-name
SQLSTATE: 42995

Error: DB2 SQL Error: SQLCODE=-530, SQLSTATE=23503, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE INSERT OR UPDATE VALUE OF
FOREIGN KEY constraint-name IS
INVALID
Explanation: An insert or update operation attempted
to place a value in a foreign key of the object table;
however, this value was not equal to some value of the
parent key of the parent table.
When a row is inserted into a dependent table, the
insert value of a foreign key must be equal to the value
of the parent key of some row of the parent table in the
associated relationship.
When the value of the foreign key is updated, the
update value of a foreign key must be equal to the
value of the parent key of some row of the parent table
of the associated relationship.
System action:
The UPDATE, MERGE, or INSERT statement cannot be
executed. The object table is unchanged.
Programmer response: Examine the insert or update
value of the foreign key first, and then compare it with
each of the parent key values of the parent table to
determine the cause of the problem.
SQLSTATE: 23503

Error: DB2 SQL Error: SQLCODE=-531, SQLSTATE=23504, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
PARENT KEY IN A PARENT ROW
CANNOT BE UPDATED BECAUSE IT
HAS ONE OR MORE DEPENDENT
ROWS IN RELATIONSHIP
constraint-name
Explanation: For plans and packages bound beginning
with Version 5 or dynamic SQL, a multi-row update of
a parent key attempted to remove a parent key value
on which a foreign key was dependent.
For plans and packages bound prior to Version 5 an
UPDATE operation attempted to update a primary key
in the specified row of the object table; however, the
primary key in the specified row had dependent rows
associated with it. The value of a primary key in a
parent row cannot be updated if the parent row has
any dependent rows.
System action: The UPDATE statement cannot be
executed. The object table is unchanged.
Programmer response: Examine the parent key of the
object table and the foreign key of the dependent table
to determine if the value of the specified row of the
parent key should be changed. If this does not expose
the problem, examine the contents of the object table
and the dependent table to determine the cause of the
problem.
SQLSTATE: 23504

Above are list of DB2 SQL Errors and Warnings from Error -526 to -531 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 &gt; 0, execution was successful with a warning.
If SQLCODE &lt; 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.

 

DB2 SQL Errors Codes and Error Messages and Warnings from Error -518 to -525

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-518, SQLSTATE=07003, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE EXECUTE STATEMENT DOES
NOT IDENTIFY A VALID PREPARED
STATEMENT
Explanation: One of the following conditions exists:
v The statement named in the EXECUTE statement has
not been prepared.
v The statement named in the EXECUTE statement
identifies a SELECT, or ASSOCIATE LOCATORS
statement
v The statement named in the EXECUTE IMMEDIATE
statement identifies a SELECT or ASSOCIATE
LOCATORS statement.
System action: The statement cannot be executed.
Programmer response: Ensure that you prepare the
statement prior to EXECUTE. Also, ensure that the
statement you prepare is not a SELECT or VALUES
INTO statement.
SQLSTATE: 07003

Error: DB2 SQL Error: SQLCODE=-519, SQLSTATE=24506, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE PREPARE STATEMENT
IDENTIFIES THE SELECT
STATEMENT OF THE OPENED
CURSOR cursor-name
Explanation: The application program has attempted
to PREPARE (actually, re-PREPARE) the SELECT
statement for the specified cursor at a time when that
cursor was already open.
System action: The statement cannot be executed. The
cursor was not affected.
Programmer response: Correct the logic of the
application program so that it does not attempt to
re-PREPARE the SELECT statement for a cursor when
that cursor is open.
SQLSTATE: 24506

Error: DB2 SQL Error: SQLCODE=-525, SQLSTATE=51015, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE SQL STATEMENT CANNOT BE
EXECUTED BECAUSE IT WAS IN
ERROR AT BIND TIME FOR SECTION
= sectno PACKAGE = pkgname
CONSISTENCY TOKEN = contoken
Explanation: One of the following:
v The statement was in error when the package was
bound, but the error was ignored then because the
option SQLERROR (CONTINUE) was used. Since the
statement contains an error, it cannot be executed.
v The statement might not be an executable statement
at this location, or might only be executable by a
DB2 application requester (for example, DECLARE
TABLE in an application running on OS/2 causes
this message).
The variables are:
sectno Section number
pkgname
locid.collid.pkgid
contoken
Consistency token in hexadecimal
System action: The statement cannot be executed.
Programmer response: If the SQL statement is not
supposed to execute at the indicated location, then
correct the program so that the statement in error does
not execute at that location. Precompile, compile, and
bind replace the package. If the SQL statement is
supposed to execute at the indicated location, correct
the problem found when it was bound and bind the
package over using BIND with ACTION(REPLACE). If
multiple versions of the package have been bound,
issue the following SELECT statement to determine
which version has the error: SELECT VERSION FROM
locid.SYSIBM.SYSPACKAGE WHERE LOCATION = ‘ ‘
AND COLLID = ‘collid’ AND NAME = ‘pkgid’ AND
HEX(CONTOKEN) = ‘contoken’
Where:
locid Location name
collid Collection id
pkgid Program name
SQLSTATE: 51015

Above are list of DB2 SQL Errors and Warnings from Error -518 to -525 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 &gt; 0, execution was successful with a warning.
If SQLCODE &lt; 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.

 

DB2 SQL Errors Codes and Error Messages and Warnings from Error -514 to -517

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-514, SQLSTATE=26501, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE CURSOR cursor-name IS NOT IN A
PREPARED STATE
Explanation: The application program has tried to use
a cursor, ‘cursor-name,’ that is not in a prepared state.
The cursor is associated with a statement that either (1)
has never been prepared, or (2) has been invalidated by
a commit or rollback operation.
System action: The statement cannot be executed.
Programmer response: For case (1), ensure that you
prepare the statement that is named in the DECLARE
CURSOR statement for ‘cursor-name’ before you try to
open the cursor. For case (2), do one of the following:
v Use the WITH HOLD option of DECLARE CURSOR.
v Do not execute a commit or rollback operation until
you are finished using the cursor.
v Prepare the statement again after the commit or
rollback.
SQLSTATE: 26501

Error: DB2 SQL Error: SQLCODE=-516, SQLSTATE=26501, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE DESCRIBE STATEMENT DOES
NOT SPECIFY A PREPARED
STATEMENT
Explanation: An attempt was made to execute a
DESCRIBE statement that did not refer to a statement
that had been successfully prepared at the current
server.
System action: The statement cannot be executed.
Programmer response: Verify that the statement name
specified in the DESCRIBE statement is a statement that
has been prepared at the current server.
SQLSTATE: 26501

Error: DB2 SQL Error: SQLCODE=-517, SQLSTATE=07005, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
CURSOR cursor-name CANNOT BE
USED BECAUSE ITS STATEMENT
NAME DOES NOT IDENTIFY A
PREPARED SELECT STATEMENT
Explanation: The cursor ‘cursor-name’ could not be
used as specified because the prepared statement
named in the declaration for the cursor was not a
SELECT statement.
System action: The statement cannot be executed.
Programmer response: Verify that the statement-name
is specified correctly in the PREPARE statement and the
DECLARE CURSOR statement for cursor ‘cursor-name’.
Alternatively, correct the application program logic to
ensure that only prepared SELECT statements are used
in association with cursor declarations.
SQLSTATE: 07005

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

 

DB2 SQL Errors Codes and Error Messages and Warnings from Error -511 to -513

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-511, SQLSTATE=42829, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE FOR UPDATE CLAUSE CANNOT
BE SPECIFIED BECAUSE THE RESULT
TABLE DESIGNATED BY THE SELECT
STATEMENT CANNOT BE MODIFIED
SQLSTATE: 42829

Error: DB2 SQL Error: SQLCODE=-512, SQLSTATE=56023, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
STATEMENT REFERENCE TO
REMOTE OBJECT IS INVALID
SQLSTATE: 56023

Error: DB2 SQL Error: SQLCODE=-513, SQLSTATE=42924, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE ALIAS alias-name MUST NOT BE
DEFINED ON ANOTHER LOCAL OR
REMOTE ALIAS
SQLSTATE: 42924

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

 
1 2 3 4 5 13