Cannot turn on constraint checking

Symptom

You receive the following error message when you try to turn on checking for a table:

DB2 Message
Cannot check or reset the Check Pending state on dependent table "TABLE1" using the SET CONSTRAINTS statement while the parent table "TABLE2" is in the check pending state.

Where TABLE1 is the table for which you are trying to turn on constraints and it is dependent on, or is a descendent of TABLE2.



Possible cause

Constraint checking is turned off for a table that the selected table is dependent on or is a descendent of. When constraint checking is turned off for a table, foreign key constraints of all of its dependent and descendent tables are turned off.

Action

Turn on constraint checking for the table or tables that the selected table is dependent on or is a descendent of. Begin with the table identified as the parent table in the DB2 message. If that table is dependent on another table, you need to turn on constraint checking in a top-down approach from the table at the top of the dependency chain.

Attention: If the selected table has a cyclical referential constraint relationship with one or more tables, you cannot use the Set Integrity window to turn on constraint checking. In this case, you must use the Command Center to issue the SQL SET CONSTRAINTS command. (For information on the syntax of the SET CONSTRAINTS command, see the SQL Reference .)