Specifying referential constraint rules
Referential constraints allow you to specify the rules that you want the system to enforce when you delete or update records.
To specify the rules that you want to enforce with referential constraints, follow these steps:
- Run the Add Physical File Constraint (ADDPFCST) command.
- Specify the rule that you want to enforce when you delete records (the delete rule) by choosing a value for the DLTRULE parameter.
- Specify the rule that you want to enforce when you update records (the update rule) by choosing a value for the UPDRULE parameter.
You can also add referential constraints using iSeries™ Navigator.
- Details: Specifying referential constraint delete rules
You can specify one of these values for the DLTRULE parameter. The delete rule specifies the action that the system takes when you delete a parent key value. The delete rule does not affect null parent key values.
- Details: Specifying referential constraint update rules
You can specify one of these values for the UPDRULE parameter. The UPDRULE parameter identifies the update rule for the constraint relationship between parent and dependent files. The update rule specifies the action that the system takes when you update the parent file.
- Details: Specifying referential constraint rules—journaling requirements
If you perform insert, update, or delete operations on a file that is associated with a referential constraint, and the delete rule, update rule, or both are other than *RESTRICT, use journaling.
Parent topic:
Adding referential constraints
Related concepts
Getting started with iSeries Navigator
SQL programming
Related reference
Add Physical File Constraint (ADDPFCST) command