Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
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:
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
FILE | File | Qualified object name | Required, Positional 1 |
Qualifier 1: File | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
CST | Constraint name | Single values: *ALL, *CHKPND Other values (up to 300 repetitions): Character value |
Required, Positional 2 |
STATE | Constraint state | *SAME, *ENABLED, *DISABLED | Optional |
Top |
Specifies the file or dependent file for which a constraint is being changed, and the library of the file or dependent file. The file must be a physical file and it must allow a maximum of one member (MAXMBRS(1)).
This is a required parameter.
Qualifier 1: File
Qualifier 2: Library
Top |
Specifies the name of the constraint relationship being changed.
This is a required parameter.
Single values
Other values (up to 300 repetitions)
Note: The case is preserved when lowercase characters are specified.
Top |
Specifies the state to which the constraint is being changed. You can use this parameter to temporarily stop (disable) a defined or established constraint from providing referential integrity (*REFCST) or data validity checking (*CHKCST), or to make a constraint that was previously disabled to start working again (enable).
Top |
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)
Top |
Top |