DB2 SQL Errors Codes and Error Messages and Warnings from Error -633 to -635

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-633, SQLSTATE: 42915, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE DELETE RULE MUST BE delete-rule
Explanation: The code is used to report that the
‘delete-rule’ specified in a FOREIGN KEY clause of the
ALTER TABLE statement is invalid. The indicated
‘delete-rule’ is required because:
v A self-referencing constraint must have a ‘delete-rule’
of CASCADE or NO ACTION.
v The relationship would cause the table to be
delete-connected to the same table through multiple
paths and such relationships must have the same
‘delete-rule’.
System action: The statement cannot be executed.
Programmer response: Change the ‘delete rule’ in the
FOREIGN KEY clause.
SQLSTATE: 42915

Error: DB2 SQL Error: SQLCODE=-634, SQLSTATE: 42915, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE DELETE RULE MUST NOT BE
CASCADE
Explanation: The code is used to report that the
CASCADE delete rule specified in the FOREIGN KEY
clause of an ALTER TABLE statement is invalid
because:
v The relationship would form a cycle that would
cause a table to be delete-connected to itself.
v The relationship would cause another table to be
delete-connected to the same table through multiple
paths with different delete rules or with a delete rule
equal to SET NULL.
System action: The statement cannot be executed.
Programmer response: Change the delete rule.
SQLSTATE: 42915

Error: DB2 SQL Error: SQLCODE=-635, SQLSTATE: 42915, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE DELETE RULES CANNOT BE
DIFFERENT OR CANNOT BE SET
NULL
Explanation: The code is used to report that the delete
rules specified in two FOREIGN KEY clauses of the
CREATE TABLE statement are invalid because the table
would be delete-connected to the same table through
multiple paths involving relationships with different
delete rules or with delete rules of SET NULL.
System action: The statement cannot be executed.
Programmer response: Change the delete rule.
SQLSTATE: 42915

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