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:

  1. Disable the relationship with the Change Physical File Constraint (CHGPFCST) CL command.
  2. Correct the key (foreign, parent, or both) data for referential constraints or column data for check constraints.
  3. 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 or by looking in the Database Maintenance folder in IBM i Navigator.