Before you add referential constraints
Before you add referential constraints, make sure that you meet these prerequisites.
- There must be a parent file with a key capable of being a parent key. If the parent file has no primary key or unique constraint, the system tries to add a primary key constraint to the parent file if the field attributes of the potential parent key match those of the foreign key field attributes of the dependent file.
- There must be a dependent file with certain attributes that match the attributes of the parent file:
- Sort sequence (SRTSEQ) must match for data types CHAR, OPEN, EITHER, and HEX.
- The coded character set identifier (CCSID) must match for each SRTSEQ table unless either (or both) of the CCSIDs is 65535.
- Each sort sequence table must match exactly.
- The dependent file must contain a foreign key that matches the following attributes of the parent key:
Parent topic:
Adding referential constraints