Message Reference

SQL0500 - SQL0599

SQL0501NThe cursor specified in a FETCH or CLOSE statement is not open.

Explanation: The program attempted to either: (1) FETCH using a cursor, or (2) CLOSE a cursor at a time when the specified cursor was not open.

The statement cannot be processed.

User Response: Check for a previous message (SQLCODE) that may have closed the cursor. Note that after the cursor is closed, any fetches or close cursor statements receive SQLCODE -501.

If no previous SQLCODEs have been issued, correct the application program to ensure that the cursor is open when the FETCH or CLOSE statement is executed.

sqlcode: -501

sqlstate: 24501

SQL0502NThe cursor specified in an OPEN statement is already open.

Explanation: The program attempted to execute an OPEN statement for an open cursor.

The statement cannot be processed. The cursor was unchanged.

User Response: Correct the application program to ensure it does not attempt to execute an OPEN statement for a cursor already open.

sqlcode: -502

sqlstate: 24502

SQL0503NA column cannot be updated because it is not identified in the FOR UPDATE clause of the SELECT statement of the cursor.

Explanation: Using a cursor, the program attempted to update a value in a table column that was not identified in the FOR UPDATE clause in the cursor declaration or the prepared SELECT statement.

Any column to be updated must be identified in the FOR UPDATE clause of the cursor declaration.

The statement cannot be processed.

User Response: Correct the application program. If the column requires updating, add its name to the FOR UPDATE clause of the cursor declaration.

sqlcode: -503

sqlstate: 42912

SQL0504NThe cursor "<name>" is not defined.

Explanation: An UPDATE or DELETE WHERE CURRENT OF "<name>" was specified, but the cursor "<name>" was not declared in the application program.

The statement cannot be processed.

User Response: Ensure the completeness of the application program and correct spelling errors in the cursor names.

sqlcode: -504

sqlstate: 34000

SQL0505NThe cursor "<name>" is already defined.

Explanation: The cursor name specified in the DECLARE statement has already been declared.

The statement cannot be processed.

User Response: Ensure the name is spelled correctly.

SQL0507NThe cursor specified in the UPDATE or DELETE statement is not open.

Explanation: The program attempted to execute an UPDATE or DELETE WHERE CURRENT OF cursor statement when the specified cursor was not open.

The statement cannot be processed. No update or delete was performed.

User Response: Check for a previous message (SQLCODE) that may have closed the cursor. Note that after the cursor is closed, any fetches or close cursor statements receive SQLCODE -501 and any updates or deletes receive SQLCODE -507. Correct the logic of the application program to ensure that the specified cursor is open at the time the UPDATE or DELETE statement is executed.

sqlcode: -507

sqlstate: 24501

SQL0508NThe cursor specified in the UPDATE or DELETE statement is not positioned on a row.

Explanation: The program attempted to execute an UPDATE or DELETE WHERE CURRENT OF cursor statement when the specified cursor was not positioned on an object table row. The cursor must be positioned on the row to be updated or deleted.

The cursor is no longer positioned on a row if the row is deleted. This includes any use of cursors within a savepoint when a ROLLBACK TO SAVEPOINT is performed.

Federated system users: the record in a remote data source has been updated and/or deleted by another application (or a different cursor within this application) and the record no longer exists.

The statement cannot be processed. No data is updated or deleted.

User Response: Correct the logic of the application program to ensure that the cursor is correctly positioned on the intended row of the object table before the UPDATE or DELETE statement is executed. Note that the cursor is not positioned on a row if FETCH returned message SQL0100W (SQLCODE = 100).

sqlcode: -508

sqlstate: 24504

SQL0509NThe table specified in the UPDATE or DELETE statement is not the same table specified in the SELECT for the cursor.

Explanation: The program attempted to execute an UPDATE or DELETE WHERE CURRENT OF cursor statement where the table named did not match the name of the table specified in the SELECT statement that declared the cursor.

The statement cannot be processed.

User Response: Correct the application program to ensure that the table identified in the UPDATE or DELETE statement is the same table identified in the cursor declaration.

sqlcode: -509

sqlstate: 42827

SQL0510NUPDATE or DELETE is not allowed against the specified cursor.

Explanation: The program attempted to execute an UPDATE or DELETE WHERE CURRENT OF cursor statement against a table or view definition that does not permit the requested update or delete operation. For example, this error can occur in a delete from a read-only view or in an update where the cursor was not defined with the FOR UPDATE clause.

On the database manager the view is read-only if the SELECT statement

Note that these conditions do not apply to subqueries of the SELECT statement.

The cursor is declared with a FOR FETCH ONLY or ORDER BY clause.

The cursor is ambiguous and the BLOCKING ALL bind option was specified.

The statement cannot be processed.

User Response: If the database manager is failing the statement and the cursor is based on a read-only SELECT or VALUES statement, do not issue any update or delete statements against it.

If the database manager is failing the statement and the cursor is not based on a read-only SELECT or VALUES statement and is defined with a FOR FETCH ONLY or ORDER BY clause, either remove this clause from the cursor definition or do not issue any update or delete statements.

If the database manager is failing the statement and the cursor cannot be determined to be either fetch only or updateable from its definition or context, rebind the program with either the BLOCKING NO or BLOCKING UNAMBIG bind option.

Federated system users: isolate the problem to the data source failing the request (see the problem determination guide for procedures to follow to identify the failing data source). If a data source is failing the request, examine the restrictions for that data source to determine the cause of the problem and its solution. If the restriction exists on a data source, see the SQL reference manual for that data source to determine why the object is not updatable.

sqlcode: -510

sqlstate: 42828

SQL0511NThe FOR UPDATE clause is not allowed because the table specified by the cursor cannot be modified.

Explanation: The result table of the SELECT or VALUES statement cannot be updated.

On the database manager, the result table is read-only if the cursor is based on a VALUES statement or the SELECT statement contains any of the following:

Note that these conditions do not apply to subqueries of the SELECT statement.

The statement cannot be processed.

User Response: Do not perform updates on the result table as specified.

Federated system users: isolate the problem to the data source failing the request (see the problem determination guide for procedures to follow to identify the failing data source). If a data source is failing the request, examine the restrictions for that data source to determine the cause of the problem and its solution. If the restriction exists on a data source, see the SQL reference manual for that data source to determine why the object is not updatable.

sqlcode: -511

sqlstate: 42829

SQL0513WThe SQL statement will modify an entire table or view.

Explanation: The UPDATE or DELETE statement does not contain a WHERE clause so all rows of the table or view are modified if this statement is executed.

The statement is accepted.

Federated system users: not all data sources report this warning condition. The federated server attempts to issue this warning whenever the condition exists, but there is no guarantee that the federated server can always detect this condition. Do not rely on this warning to preclude UPDATE/DELETE operations from affecting an entire table or view.

User Response: Ensure that you intend to modify the entire table or view.

SQL0514NThe cursor "<name>" is not in a prepared state.

Explanation: The application program tried to use a cursor "<name>" that is not in a prepared state. The cursor is associated with a statement that either (1) was never prepared, (2) was made not valid by a ROLLBACK, or (3) was made not valid by either an explicit or implicit rebind of the package.

The statement cannot be processed.

User Response: For case (1), prepare the statement named in the DECLARE CURSOR statement for "<name>" before you try to open the cursor. For case (2), do not issue a ROLLBACK until after you finish using the cursor. For case (3), the prepare for the cursor must be reissued.

sqlcode: -514

sqlstate: 26501

SQL0516NThe DESCRIBE statement does not specify a prepared statement.

Explanation: The statement name in the DESCRIBE statement must specify a statement that was prepared in the same database transaction.

The statement cannot be processed.

User Response: Verify that the statement name specifies a statement that has been prepared.

sqlcode: -516

sqlstate: 26501

SQL0517NThe cursor "<name>" identifies a prepared statement that is not a SELECT or VALUES statement.

Explanation: The cursor "<name>" could not be used as specified because the prepared statement named in the cursor declaration was not a SELECT or VALUES statement.

The statement cannot be processed.

User Response: Verify that the statement name is specified correctly in the PREPARE and the DECLARE CURSOR for cursor "<name>" statements. Or correct the program to ensure that only prepared SELECT or VALUES statements are used in association with cursor declarations.

sqlcode: -517

sqlstate: 07005

SQL0518NThe statement named in the EXECUTE statement is not in a prepared state or is a SELECT or VALUES statement.

Explanation: The application program tried to EXECUTE a statement that (1) was never prepared, (2) was made not valid by a ROLLBACK, (3) is a SELECT or VALUES statement, or (4) was made not valid by either an explicit or implicit rebind of the package.

The statement cannot be processed.

User Response: For case (1), prepare the statement before attempting the EXECUTE. For case (2), either do not issue a ROLLBACK until after you finish using the prepared statement, or prepare the statement again after the ROLLBACK. For case (3), ensure that the statement is not a SELECT or VALUES statement. For case (4), the prepare for the cursor must be reissued.

sqlcode: -518

sqlstate: 07003

SQL0519NThe PREPARE statement identifies the SELECT or VALUES statement of the open cursor "<name>".

Explanation: The application program attempted to prepare the SELECT or VALUES statement for the specified cursor when that cursor is already open.

The statement cannot be prepared. The cursor was not affected.

User Response: Correct the application program so it does not attempt to prepare the SELECT or VALUES statement for a cursor that is open.

sqlcode: -519

sqlstate: 24506

SQL0525NThe SQL statement cannot be executed because it was in error at bind time for section = "<sectno>" package = "<pkgname>" consistency token = X"<contoken>".

Explanation: One of the following:

The variables are:

sectno
Section number

pkgname
locid.collid.pkgid

contoken
Consistency token in hexadecimal

The statement cannot be executed.

User 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

sqlcode: -525

sqlstate: 51015

SQL0526NThe requested function does not apply to declared temporary tables.

Explanation: The SQL statement being executed refers to a declared temporary table. A declared temporary table cannot be used in the given context.

The statement cannot be processed.

User Response: Modify the SQL statement to ensure that the object references are not to declared temporary tables.

sqlcode: -526

sqlstate: 42995

SQL0528NThe table "<tablename>" already has a unique constraint that is a duplicate of constraint "<name>".

Explanation: A UNIQUE clause uses the same column list as the PRIMARY KEY clause, another UNIQUE clause or the PRIMARY KEY or a UNIQUE constraint that already exists for the table "<tablename>". Duplicate unique constraints are not allowed.

"<name>" is the constraint name, if one was specified or exists. If a constraint name is not specified, "<name>" is the first column name specified in the column list of the UNIQUE clause followed by three periods.

The statement cannot be processed.

User Response: Remove the duplicate UNIQUE clause or change the column list to a set of columns that is not already part of a unique constraint.

sqlcode: -528

sqlstate: 42891

SQL0530NThe insert or update value of the FOREIGN KEY "<constraint-name>" is not equal to any value of the parent key of the parent table.

Explanation: A value in a foreign key of the object table is being set, but this value is not equal to any 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 some value of the parent key of any row of the parent table of the associated relationship.

Similarly, when the value of a foreign key is updated, the update value of a foreign key must be equal to the value of the parent key of any row of the parent table of the associated relationship at the completion of the statement.

Federated system users: the constraint can exist on the data source (if the child and parent tables exist on the data source).

Some data sources do not provide the appropriate values for "<constraint name>". In these cases the message token will have the following format: "<data source>:UNKNOWN", indicating that the actual value for the specified data source is unknown.

The statement could not be executed. The contents of the object table are unchanged.

User 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 and correct the problem.

sqlcode: -530

sqlstate: 23503

SQL0531NThe parent key in a parent row of relationship "<constraint-name>" cannot be updated.

Explanation: An operation attempted to update a parent key in the row of the parent table but the parent key in the specified row has dependent rows in the dependent table associated with it in the "<constraint-name>" constraint.

When the update rule of constraint "<constraint-name>" is NO ACTION, the value of a parent key in a parent row cannot be updated if the parent row has any dependent rows at the completion of the statement.

When the update rule of constraint "<constraint-name>" is RESTRICT, the value of a parent key in a parent row cannot be updated if the parent row has any dependent rows at the time the update of the parent key is attempted.

Federated system users: the constraint can exist on the data source (if the child and parent tables exist on the data source).

Some data sources do not provide the appropriate values for "<constraint name>". In these cases the message token will have the following format: "<data source>:UNKNOWN", indicating that the actual value for the specified data source is unknown.

The statement could not be executed. The contents of the parent table are unchanged.

User 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 show the problem, examine the contents of the object table and the dependent table to determine and correct the problem.

sqlcode: -531

sqlstate: 23001, 23504

SQL0532NA parent row cannot be deleted because the relationship "<constraint-name>" restricts the deletion.

Explanation: An operation attempted to delete a specified row of the parent table but the parent key in the specified row has dependent rows in the referential constraint "<constraint-name>" and the delete rule of NO ACTION or RESTRICT is specified for the relationship.

When the delete rule of constraint "<constraint-name>" is NO ACTION, a row of the parent table cannot be deleted if the dependent rows are still dependent on the parent key at the completion of the statement.

When the delete rule of constraint "<constraint-name>" is RESTRICT, a row of the parent table cannot be deleted if the parent row has any dependent rows at the time of the delete.

Note that a delete can cascade to delete other rows in dependent tables that have a delete rule of NO ACTION or RESTRICT. Thus the constraint "<constraint-name>" may be on a different table than the original delete operation.

Federated system users: the constraint can exist on the data source (if the child and parent tables exist on the data source).

Some data sources do not provide the appropriate values for "<constraint name>". In these cases the appropriate fields contain values (such as "unknown") that indicate that the actual value is unknown.

The statement could not be executed. The contents of the table are unchanged.

User Response: Examine the delete rule for all descendent tables to determine and correct the problem. The specific tables involved can be determined from the relationship "<constraint-name>".

sqlcode: -532

sqlstate: 23001, 23504

SQL0533NThe INSERT statement is not valid because a relationship restricts the result of the fullselect to one row.

Explanation: An INSERT operation with a fullselect attempted to insert multiple rows into a table that is a parent and a dependent in the same relationship of a referential constraint.

The fullselect of the INSERT operation should return no more than one row of data.

The INSERT statement could not be executed. The contents of the object table are unchanged.

Federated system users: the constraint can exist on the data source (if the child and parent tables exist on the data source).

User Response: Examine the search condition of the fullselect to ensure selection of no more than one row of data.

sqlcode: -533

sqlstate: 21501

SQL0534NInvalid multiple-row update.

Explanation: An UPDATE operation attempted to perform a multiple-row update of a column included in a primary key or unique index.

Multiple-row updates of columns of a primary key or unique index are not supported.

The UPDATE statement could not be executed. The contents of the table are unchanged.

Federated system users: the constraint can exist on federated server (if the child and parent tables exist as tables on federated server), or it can exist on the data source (if the child and parent tables exist on the data source).

User Response: Ensure the search condition of the UPDATE statement selects only one object table row to update.

sqlcode: -534

sqlstate: 21502

SQL0535NThe DELETE statement is not valid because a self-referencing relationship restricts the deletion to one row.

Explanation: A DELETE operation with a WHERE clause attempted to delete multiple rows from a table which is a parent and a dependent in the same relationship of a referential constraint with a RESTRICT or SET NULL delete rule.

The WHERE clause of the DELETE operation should select no more than one row of data.

The DELETE statement could not be executed. The contents of the object table are unchanged.

Federated system users: the constraint can exist on the data source (if the child and parent tables exist on the data source).

User Response: Examine the WHERE clause search condition to ensure no more than one row of data is selected.

NOTE: This is only a restriction in releases of DB2 prior to Version 2.

sqlcode: -535

sqlstate: 21504

SQL0536NThe DELETE statement is not valid because table "<name>" can be affected by the operation.

Explanation: A DELETE operation was attempted with the indicated table referenced in a subquery.

The indicated table referenced in a subquery of the DELETE statement can be affected because it is either:

Federated system users: the constraint can exist on the data source (if the child and parent tables exist on the data source).

Some data sources do not provide the appropriate values for "<name>". In these cases the appropriate fields contain values (such as "unknown") that indicate that the actual value is unknown.

The statement could not be processed.

User Response: Do not reference a table in a DELETE statement subquery when the table can be affected by the DELETE statement.

NOTE: This error is only applicable to releases of DB2 prior to Version 2 and hosts accessed through DB2 Connect.

sqlcode: -536

sqlstate: 42914

SQL0537NThe PRIMARY KEY clause, a FOREIGN KEY clause, a UNIQUE clause, or a PARTITIONING KEY clause identifies column "<name>" more than once.

Explanation: The column "<name>" appears more than once in a PRIMARY KEY clause, FOREIGN KEY clause, UNIQUE clause or PARTITIONING KEY clause of a CREATE or ALTER statement.

Federated system users: the constraint can exist on the data source (if the child and parent tables exist on the data source).

Some data sources do not provide the appropriate values for "<name>". In these cases the appropriate fields contain values (such as "unknown") that indicate that the actual value is unknown.

The statement cannot be processed.

User Response: Specify unique names for each column.

sqlcode: -537

sqlstate: 42709

SQL0538NFOREIGN KEY "<name>" does not conform to the description of the parent key of table "<table-name>".

Explanation: The definition of the indicated foreign key does not conform to the parent key description of the table "<table-name>".

Possible errors are:

"<name>" is the constraint name if specified in the FOREIGN KEY clause. If a constraint name was not specified, "<name>" is the first column name specified in the clause followed by three periods.

Federated system users: some data sources do not provide the appropriate values for "<name>" and "<table-name>". In these cases the appropriate fields contain values (such as "unknown") that indicate that the actual value is unknown.

The constraint can exist the data source (if the child and parent tables exist on the data source).

The statement cannot be processed.

User Response: Correct the statement so the foreign key description conforms to the parent key description.

sqlcode: -538

sqlstate: 42830

SQL0539NTable "<name>" does not have a "<key-type>" key.

Explanation: One of the following occurred:

Federated system users: the constraint can exist on the data source (if the child and parent tables exist on the data source).

Some data sources do not provide the appropriate values for "<name>" and "<key-type>". In these cases the appropriate fields contain values (such as "unknown") that indicate that the actual value is unknown.

The statement cannot be processed. A system catalog cannot be defined as a parent in a referential constraint.

User Response: When creating a referential constraint, specify the primary key before specifying any foreign keys (constraints).

sqlcode: -539

sqlstate: 42888

SQL0540NThe definition of table "<table-name>" is incomplete because it lacks a primary index or a required unique index.

Explanation: The table named was defined with a PRIMARY KEY clause or a UNIQUE clause. Its definition is incomplete, and it cannot be used until a unique index is defined for the primary key (the primary index) and 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.

The statement cannot be executed.

User Response: Define a primary index or a required unique index on the table before referencing it.

sqlcode: -540

sqlstate: 57001

SQL0541WThe referential, primary key, or unique constraint "<name>" is ignored because it is a duplicate constraint.

Explanation: If "<name>" refers to a referential constraint, then a FOREIGN KEY clause uses the same foreign key and parent table as another FOREIGN KEY clause.

If "<name>" refers to a primary key or unique constraint, then one of the following situations exists.

"<name>" is the constraint name, if specified. If a constraint name was not specified, "<name>" is the first column name specified in the column list of the FOREIGN KEY or UNIQUE clause followed by three periods.

Federated system users: the constraint can exist on the data source (if the child and parent tables exist on the data source).

Some data sources do not provide the appropriate values for "<name>". In these cases the appropriate fields contain values (such as "unknown") that indicate that the actual value is unknown.

The indicated referential constraint or unique constraint was not created. The statement was processed successfully.

User Response: No action is required. Processing can continue.

sqlcode: +541

sqlstate: 01543

SQL0542N"<name>" cannot be a column of a primary key or unique key because it can contain null values.

Explanation: The column "<name>" identified in a PRIMARY KEY clause or UNIQUE clause is defined to allow null values.

Federated system users: some data sources do not provide the appropriate values for "<name>". In these cases the appropriate fields contain values (such as "unknown") that indicate that the actual value is unknown.

The statement cannot be processed.

User Response: Correct the column, primary key or unique key definition.

sqlcode: -542

sqlstate: 42831

SQL0543NA row in a parent table cannot be deleted because the check constraint "<constraint-name>" 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.

The statement cannot be processed.

User 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 with each other.

sqlcode: -543

sqlstate: 23511

SQL0544NThe check constraint "<constraint-name>" cannot be added because the table contains a row that violates the constraint.

Explanation: At least one existing row in the table violates the check constraint that is be added in the ALTER TABLE statement.

The statement cannot be processed.

User Response: Examine the check constraint definition that was specified in the ALTER TABLE statement and the data in the table to determine why there is a violation of the constraint. Change either the check constraint or the data so that the constraint is not violated.

sqlcode: -544

sqlstate: 23512

SQL0545NThe requested operation is not allowed because a row does not satisfy the check constraint "<constraint-name>".

Explanation: Check constraint violations can occur on either INSERT or UPDATE operations. The resulting row violated the check constraint definition on that table.

The statement cannot be processed.

User Response: Examine the data and the check constraint definition in the catalog view SYSCAT.CHECKS to determine why the INSERT or UPDATE statement failed. Change the data so that the constraint is not violated.

sqlcode: -545

sqlstate: 23513

SQL0546NThe 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:

The statement cannot be processed.

User Response: The user response is one of the following, depending on the cause of the error:

sqlcode: -546

sqlstate: 42621

SQL0548NA check constraint that is defined with "<check-condition-element>" is invalid.

Explanation: A check constraint in the CREATE TABLE or ALTER TABLE statement is invalid for one or more of the following reasons:

The token within the text of the error message lists the invalid item.

The statement cannot be processed.

User Response: The user response is one of the following, depending on the cause of the error:

sqlcode: -548

sqlstate: 42621.

SQL0549NThe "<statement>" statement is not allowed for "<object-type1 >" "<object-name1>" because the bind option DYNAMICRULES(BIND) in the "<object-type2>" is in effect.

Explanation: A program attempted to issue the indicated SQL statement that is one of several SQL statements that cannot be issued from a package or plan for which the option DYNAMICRULES(BIND) is in effect. Those SQL statements are:

"<statement>"
The SQL statement in error

"<object-type1>"
PACKAGE or DBRM. DBRM is valid only in a DRDA connection.

"<object-name1>"
If "<object-type1>" is PACKAGE, "<object-name1>" is the name of the package in the format 'location-id.collection-id.package-id'. If "<object-type1>" is DBRM, "<object-name1>" is the name of the DBRM in the format 'plan-name DBRM-name'.

"<object-type2>"
PACKAGE or PLAN. PLAN is valid only in a DRDA connection. If "<object-type1>" is PACKAGE, "<object-type2>" can be either PACKAGE or PLAN (whichever is bound with DYNAMICRULES(BIND)). If "<object-type1>" is DBRM, "<object-type2>" is PLAN.
The SQL statement cannot be executed.

User Response: Do one of the following to correct the error:

sqlcode: -549

sqlstate: 42509

SQL0551N"<authorization-ID>" does not have the privilege to perform operation "<operation>" on object "<name>".

Explanation: Authorization ID "<authorization-ID>" attempted to perform the specified "<operation>" on "<name>" without the proper authorization.

If creating or altering a table with referential constraints, this message (SQLCODE) can indicate that the user does not have the REFERENCES privilege to create or drop a FOREIGN KEY. In this case the "<operation>" is "REFERENCES" and the "<name>" is the object the constraint references.

If attempting to run a DB2 utility or CLI application, the DB2 utility programs may need to be rebound to the database because the userid who created the database no longer exists or no longer has the required privileges.

Federated system users: if this message is returned when the user is changing the remote_pw column of the SYSCAT.USEROPTIONS view, the user is not authorized to change a password for another user. The user performing the alter operation must have either SYSADM authority or an authorization ID (the value in the USER special register) that matches the value of the authid column in the rows being updated. Some data sources do not provide the appropriate values for "<authid>", <operation>, and <name>. In these cases the message tokens will have the following format: "<data source> AUTHID:UNKNOWN", "UNKNOWN", and "<data source>:TABLE/VIEW", indicating that the actual values for the authid, operation, and name at the specified data source are not known.

The statement cannot be processed.

User Response: Ensure that "<authorization-ID>" has the authorization necessary to perform the operation.

Federated system users: this authorization can be at the federated server, the data source, or both.

If the DB2 utility programs need to be rebound to the database, the database administrator can accomplish this by issuing one of the following CLP command from the bnd subdirectory of the instance, while connected to the database:

sqlcode: -551

sqlstate: 42501

SQL0552N"<authorization-ID>" does not have the privilege to perform operation "<operation>".

Explanation: Authorization ID "<authorization-ID>" attempted to perform the specified "<operation>" without the proper authorization.

Federated system users: some data sources do not provide the appropriate values for "<authorization-ID>" and <operation>. In these cases the message tokens will have the following format: "<data source> AUTHID:UNKNOWN", and "UNKNOWN" indicating that the actual values for authid and operation at the specified data source are not known.

The statement cannot be processed.

User Response: Ensure that "<authorization-ID>" has the authorization to perform the operation.

Federated system users: this authorization can be at the federated server, the data source, or both.

sqlcode: -552

sqlstate: 42502

SQL0553NAn object cannot be created with the schema name "<schema-name>".

Explanation: The reason the schema name "<schema-name>" is invalid depends on the type of object that is being created.

The statement cannot be processed.

User Response: Use a valid schema name or remove the explicit schema name and rerun the statement.

sqlcode: -553

sqlstate: 42939

SQL0554NAn authorization ID cannot grant a privilege to itself.

Explanation: An authorization ID attempted to execute a GRANT statement where the authorization ID itself appears as one of the entries in the authorization ID list to which privileges are to be granted.

The statement cannot be processed.

User Response: Remove the authorization ID from the list.

sqlcode: -554

sqlstate: 42502

SQL0555NAn authorization ID cannot revoke a privilege from itself.

Explanation: An authorization ID attempted to execute a REVOKE statement where the authorization ID itself appears as one of the entries in the authorization ID list from which privileges are to be revoked.

The statement cannot be processed.

User Response: Remove the authorization ID from the list.

sqlcode: -555

sqlstate: 42502

SQL0556NAn attempt to revoke a privilege from "<authorization-ID>" was denied because "<authorization-ID>" does not hold this privilege.

Explanation: The privilege cannot be revoked because "<authorization-ID>" does not hold the privilege.

The statement cannot be processed.

User Response: Change the REVOKE statement to conform to the REVOKE rules and resubmit the statement. Ensure that when a REVOKE statement lists several privileges to be revoked and a list of authorization IDs that each authorization ID possesses at least one of the specified privileges.

sqlcode: -556

sqlstate: 42504

SQL0557NThe specified combination of privileges cannot be granted or revoked.

Explanation: One of the following occurred:

The statement cannot be processed.

User Response: Correct and resubmit the statement.

sqlcode: -557

sqlstate: 42852

SQL0558NAn attempt to revoke a privilege from "<authorization-ID>" was denied because "<authorization-ID>" would still hold "<control>" authority.

Explanation: "<authorization-ID>" holds the "<control>" privilege. The privilege to be revoked is implicit in the "<control>" privilege, so it cannot be revoked unless the "<control>" privilege is also revoked.

The valid values for "<control>" are the following:

The statement cannot be executed. No privileges are revoked.

User Response: Revoke the "<control>" privilege, if desired.

sqlcode: -558

sqlstate: 42504

SQL0562NThe specified database privileges cannot be granted to PUBLIC (public).

Explanation: The GRANT statement attempted to grant a database privilege to the reserved authorization ID PUBLIC (public). DBADM authority cannot be granted to PUBLIC (public).

The statement cannot be processed.

User Response: The implied function is not supported.

sqlcode: -562

sqlstate: 42508

SQL0567N"<authorization-ID>" is not a valid authorization ID.

Explanation: The authorization ID specified by "<authorization-ID>" is not valid for one of the following reasons:

The statement cannot be processed.

User Response: Correct the invalid authorization ID.

sqlcode: -567

sqlstate: 42602

SQL0569NThe GRANT/REVOKE statement failed because "<authorization-name>" may identify both a user and a group in the system.

Explanation: The GRANT or REVOKE statement specified an authorization name that may identify both a user and a group in the security namespace, and did not explicitly specify the USER or GROUP keyword in the statement. The statement is therefore ambiguous. Note that when using DCE security, the USER or GROUP keyword is always required.

User Response: Change the statement to explicitly specify the USER or GROUP keyword to uniquely identify the required authorization id.

sqlcode: -569

sqlstate: 56092

SQL0570WNot all requested privileges on object "<object-name>" of type "<object-type>" were granted.

Explanation: A GRANT operation was attempted on object "<object-name>" of type "<object-type>", but some or all of the privileges were not granted. The authorization ID that issued the statement does not have all of the privileges to be granted with grant option or does not have DBADM authority.

All valid requested privileges were granted.

User Response: Obtain the required authority and try the the operation again.

sqlcode: +570

sqlstate: 01007

SQL0572NPackage "<pkgname>" is inoperative.

Explanation: The package "<pkgname>" is marked as inoperative and must be explicitly rebound before it can be used. This package cannot be used because one or more user-defined functions that it depends upon have been dropped.

User Response: Explicitly rebind the named package using either the REBIND or the BIND command.

sqlcode: -572

sqlstate: 51028

SQL0573NA column list specified in the references clause of constraint "<name>" does not identify a unique constraint of the parent table "<table-name>".

Explanation: A list of column names was specified in the references clause for the constraint identified by "<name>" that does not match the column names of the primary key or any unique key of the referenced table "<table-name>".

"<name>" is the constraint name, if specified. If a constraint name was not specified, "<name>" is the first column name specified in the column list of the FOREIGN KEY clause followed by three periods.

The statement cannot be processed.

User Response: Correct the column list in the references clause or add the unique constraint to the referenced table.

sqlcode: -573

sqlstate: 42890

SQL0574NDEFAULT value or IDENTITY attribute value is not valid for column "<column-name>" in table "<table-name>". Reason code: "<reason-code>".

Explanation: The DEFAULT value or IDENTITY attribute value for column "<column-name>" in table "<table-name>" is not valid. The possible reason codes are as follows:

1
The value is not assignable to the column because the constant does not conform to the format for a constant of that data type, the value has an incorrect length or precision, or the function returns an incorrect data type.

2
A floating-point constant is specified and the column is not a floating point data type

3
A decimal constant is specified and non-zero digits would be truncated when assigned to the column

4
The value is more than 254 bytes, including quotes for strings, introducer characters such as the X for a hex constant, fully qualified function names, and parentheses. Non-significant blanks in the value are ignored. In an unequal code page environment, the value may be more than 254 bytes due to expansion of the string in the database code page.

5
The USER special register is specified and the length attribute of the character string data type is less than 8.

6
A datetime special register (CURRENT DATE, CURRENT TIME, or CURRENT TIMESTAMP) is specified and does not match the data type of the column.

7
A function was specified that is not supported. The specified function must be system-generated cast function or one of the built-in functions BLOB, DATE, TIME, or TIMESTAMP.

8
The argument to a datetime function was not a character string constant or the corresponding datetime special register.

9
A system-generated cast function was specified and the column is not defined with a user-defined distinct type.

10
A value with non-zero scale was specified for the START WITH or INCREMENT BY option of an identity column.

<0
Any reason code that is less than zero is an SQLCODE. The error in the DEFAULT value specification can be determined by checking the error message corresponding to this SQLCODE.

The statement cannot be processed.

User Response: Correct the DEFAULT value or IDENTITY attribute value based on the reason code that was returned.

sqlcode: -574

sqlstate: 42894

SQL0575NView or summary table "<name>" cannot be used because it has been marked inoperative.

Explanation: The view or summary table "<name>" has been marked inoperative because a table, view, alias, or privilege upon which it is dependent has been removed. The view cannot be used by any SQL statement other than one of the following:

The statement cannot be processed.

User Response: If "<name>" is a view, recreate the view by issuing a CREATE VIEW statement using the same view definition as the inoperative view. If "<name>" is a summary table, recreate the summary table by issuing the CREATE TABLE statement using the same summary table definition as in the inoperative summary table.

sqlcode: -575

sqlstate: 51024

SQL0576NAlias "<name>" cannot be created for "<name2>" as it would result in a repetitive alias chain.

Explanation: The alias definition of "<name>" on "<name2>" would have resulted in a repetitive alias chain which could never be resolved. For example, "alias A refers to alias B which refers to alias A" is a repetitive alias chain which could never be resolved.

The statement cannot be processed.

User Response: Change the alias definition for "<name>" or revise the definition of one of the other alias definitions in the alias chain to avoid a repetitive chain.

sqlcode: -576

sqlstate: 42916

SQL0577NUser defined function or procedure "<function-name>" (specific name "<specific-name>") attempted to modify data but was not defined as MODIFIES SQL DATA.

Explanation: The program used to implement the body of a user defined function or procedure is not allowed to modify SQL data.

User Response: Remove any SQL statements that modify data then recompile the program. For stored procedures, investigate the level of SQL allowed as specified on the CREATE PROCEDURE statement.

sqlcode: -577

sqlstate: 38002

sqlstate: 42985

SQL0579NUser defined function or procedure "<function-name>" (specific name "<specific-name>") attempted to read data but was not defined as READ SQL DATA or MODIFIES SQL DATA.

Explanation: The program used to implement the body of a user defined function or procedure is not allowed to read SQL data.

User Response: Remove any SQL statements that read data then recompile the program. For stored procedures, investigate the level of SQL allowed as specified on the CREATE PROCEDURE statement.

sqlcode: -579

sqlstate: 38004

sqlstate: 42985

SQL0580NThe result-expressions of a CASE expression cannot all be NULL.

Explanation: There is a CASE expression in the statement that has all the result-expressions (expressions following THEN and ELSE keywords) coded with the keyword NULL.

The statement cannot be processed.

User Response: Change the CASE expression to include at least one result-expression that is other than the keyword NULL.

sqlcode: -580

sqlstate: 42625

SQL0581NThe data types of the result-expressions of a CASE expression are not compatible.

Explanation: There is a CASE expression in the statement that has result-expressions (expressions following THEN and ELSE keywords) that are not compatible.

The data type of a CASE expression is determined using the "Rules for Result Data Types" on the result-expressions. The data types of the result-expressions may be incompatible for one of the following reasons:

The statement cannot be processed.

User Response: Correct the result-expressions so that they are compatible.

sqlcode: -581

sqlstate: 42804

SQL0582NA CASE expression in a VALUES clause, IN predicate, GROUP BY clause, or ORDER BY clause cannot include a quantified predicate, an IN predicate using a fullselect, or an EXISTS predicate.

Explanation: A search condition of a CASE expression is:

and the CASE expression is part of:

Such CASE expressions are not supported. The CASE expression may be part of a function written in SQL.

The statement cannot be processed.

User Response: Remove the use of the quantified predicate, IN predicate, or EXISTS predicate from the CASE expression. If the CASE expression is part of a function, the query may need to be written without the function that causes the error.

sqlcode: -582

sqlstate: 42625

SQL0583NThe use of routine "<routine-name>" is invalid because it is not deterministic or has an external action.

Explanation: The routine (function or method) "<routine-name>" is defined as a non-deterministic routine or a routine with an external action. This type of routine is not supported in the context in which it is used. The contexts in which these are not valid are:

The statement cannot be processed.

User Response: If the use of a non-deterministic or external action routine was not intended, substitute a routine without these characteristics. If the behavior associated with the non-deterministic or external action routine is intentional, use the alternate form of the statements that make that intent explicit.

sqlcode: -583

sqlstate: 42845

SQL0584NInvalid use of NULL or DEFAULT.

Explanation: DEFAULT can only be used in a VALUES clause that is part of an INSERT statement.

A VALUES clause that is not part of an INSERT statement must have a value other than NULL in at least one row for each column.

If DEFAULT is used as a column-name in a WHERE or HAVING clause, it must be capitalized and enclosed in double quotes.

Federated system users: DEFAULT can not be used in a VALUES clause of an INSERT statement where the object is a nickname.

User Response: Substitute a value other than NULL or DEFAULT in the VALUES clause. If DEFAULT is used as a column-name, capitalize it and enclose it in double quotes.

sqlcode: -584

sqlstate: 42608

SQL0585NThe schema name "<schema-name>" can not appear more than once in the function path.

Explanation: The function path includes "<schema-name>" more than once. The function path can only include one occurrence of each schema name.

The statement cannot be processed.

User Response: Remove duplicate occurrences of "<schema-name>" from the function path.

sqlcode: -585

sqlstate: 42732

SQL0586NThe total length of the CURRENT FUNCTION PATH special register cannot exceed 254 characters.

Explanation: The CURRENT FUNCTION PATH special register is defined as a VARCHAR(254). The content of the string includes each schema name delimited with double quotes and separated from the next schema name by a comma. The total length of the string of all schema names in the CURRENT FUNCTION PATH cannot exceed 254 characters. The SET CURRENT FUNCTION PATH statement or the FUNCPATH option of the PREP or BIND command causing this message would exceed this limit.

The statement or command cannot be processed.

User Response: Remove schema names to reduce the total length to fit the 254 character maximum length. If all the schema names are required, it may be necessary to consolidate some user-defined functions so that less schema names are required on the CURRENT FUNCTION PATH.

sqlcode: -586

sqlstate: 42907

SQL0590NName "<name>" specified in procedure "<procedure>" is not unique.

Explanation: Name "<name>" is specified as a parameter, SQL variable, cursor, label, or condition in procedure "<procedure>". The name is not unique.

User Response: Change the name so that it is unique.

sqlcode: -590

sqlstate: 42734

SQL0595WIsolation level "<requested-level>" has been escalated to "<escalated-level>".

Explanation: The isolation level specified is not supported by DB2. It has been escalated to the next higher level of isolation supported by DB2.

User Response: To avoid this warning, specify an isolation level which is supported by DB2. DB2 supports isolation levels Repeatable Read (RR), Read Stability (RS), Cursor Stability (CS), and Uncommitted Read (UR).

sqlcode: +595

sqlstate: 01526

SQL0598WExisting index "<name>" is used as the index for the primary key or a unique key.

Explanation: An index was required for an ALTER TABLE operation that defined a primary key or a unique key, and the indicated index matches the required index.

When creating a primary key or unique key index, an index description matches if it identifies the same set of columns (in any order) as the primary or unique key without regard to ascending or descending specifications, and is specified as unique.

The statement is processed successfully.

User Response: No action is required.

sqlcode: +598

sqlstate: 01550

SQL0599WComparison functions are not created for a distinct type based on a long string data type.

Explanation: Comparison functions are not created for a distinct type based on a long string data type (BLOB, CLOB, DBCLOB, LONG VARCHAR, or LONG VARGRAPHIC) since the corresponding functions are not available for these built-in data types.

This is a warning situation. The statement is processed successfully.

User Response: No action is required.

sqlcode: +599

sqlstate: 01596


[ Top of Page | Previous Page | Next Page ]