Check pending
Referential constraints and check constraints can be in a check pending state, where potential violations of the constraints exist.
For referential constraints, a violation occurs when potential mismatches exist between parent and foreign keys. For check constraints, a violation occurs when potential values exist in columns that are limited by the check constraint. When the system determines that a constraint might have been violated (such as after a restore operation), the constraint is marked as check pending. When this happens, restrictions are placed on the use of tables involved in the constraint. For referential constraints, the following restrictions apply:
- No input or output operations are allowed on the dependent file.
- Only read and insert operations are allowed on the parent file.
When a check constraint is in check pending, the following restrictions apply:
- Read operations are not allowed on the file.
- Insert and update operations are allowed and the constraint is enforced.
To get a constraint out of check pending, follow these steps:
- Disable the relationship with the Change Physical File Constraint (CHGPFCST) CL command.
- Correct the key (foreign, parent, or both) data for referential constraints or column data for check constraints.
- Enable the constraint again with the CHGPFCST CL command.
You can identify the rows that are in violation of the constraint with the Display Check Pending Constraint (DSPCPCST) CL command.
Parent topic:
Creating a table
Related concepts
Check pending status in referential constraints
Related tasks
Working with constraints that are in check pending status