CL Command Reference - CHGPFCST

CL Command List > CHGPFCST Reference

Description:

The Change Physical File Constraint (CHGPFCST) command changes the state of one or more check constraints for a file or referential constraints between local database files. For referential constraints, the local database files of a constraint are physical files that have been defined in a parent and dependent relationship with either the SQL interface or the Add Physical File Constraint (ADDPFCST) command. For check constraints, the file for the check expression is the file that has been defined in a constraint with either the SQL interface or the Add Physical File Constraint (ADDPFCST) command.

The state of a referential constraint can be changed to disabled (stopped from providing referential integrity) or, if it has been disabled, to enabled (providing referential integrity again). The state of a check constraint can be changed to disabled (stopped from providing validity checking) or, if it has been disabled, to enabled (providing validity checking again). The alternative to changing the state of the constraint is to remove it when you do not want it to be used, and add it again when you need it.

Restrictions:

. You must have object management (*OBJMGT) or object alter (*OBJALTER) authority to the physical file.

. You must have execute (*EXECUTE) authority to the library that contains the physical file.


Examples:

CHGPFCST FILE(ADMN/PERSONNEL) CST(*CHKPND)
STATE(*DISABLED)

This command disables the referential constraints that have caused records in the PERSONNEL file of the ADMN library to be in check pending status. While referential integrity is disabled, the user can correct the records that are causing the check pending.

After the records are corrected, the following command is run to provide referential integrity again.

CHGPFCST FILE(ADMN/PERSONNEL) CST(*CHKPND)
STATE(*ENABLED)