Where allowed to run: All environments (*ALL) Threadsafe: Conditional |
Parameters Examples Error messages |
The Remove Physical File Constraint (RMVPFCST) command can be used to remove one or more constraint relationships between physical files. The constraint relationships that can be removed with this command are referential constraints, unique constraints, primary key constraints, and check constraints.
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 |
TYPE | Constraint type | *ALL, *REFCST, *UNQCST, *PRIKEY, *CHKCST | Optional, Positional 3 |
RMVCST | Remove constraint | *RESTRICT, *REMOVE, *KEEP | Optional |
Top |
Specifies the physical file from which a constraint is to be removed. For a referential constraint, this file can be a dependent file only.
This is a required parameter.
Qualifier 1: File
Qualifier 2: Library
Top |
Specifies the name of the constraint relationship being removed.
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 type of constraint relationship named on the CST parameter that is being removed from the physical file.
Note: This value is ignored for referential constraints when the RMVCST parameter is specified.
Note: If the unique constraint is a primary key, the unique constraint is removed, but the primary key definition and the file's access path are not removed.
The following are examples of the CST parameter dependencies:
Top |
Specifies how much of the constraint relationship on the dependent file is removed when a primary key or unique constraint that is also a parent key is removed from the parent file of a referential constraint.
Note: This parameter is ignored if *REFCST is specified for the Constraint type (TYPE) parameter.
Top |
In these examples, the unique constraint UNIQUE_Department_NUMBER and the referential constraint EMPLOYEE_Department were added to the files by issuing the following Add Physical File Constraint (ADDPFCST) commands:
ADDPFCST FILE(MYLIB/DEPARTMENTS) TYPE(*UNQCST) KEY(DEPTNUM) CST(UNIQUE_Department_NUMBER) ADDPFCST FILE(MYLIB/PERSONNEL) TYPE(*REFCST) KEY(DEPTNO) CST(EMPLOYEE_Department)
Example 1: Removing a Unique Constraint
RMVPFCST FILE(MYLIB/DEPARTMENTS) CST(*ALL) TYPE(*ALL)
This command removes the unique constraint UNIQUE_Department_NUMBER from the file DEPARTMENTS located in the library MYLIB.
Example 2: Removing a Referential Constraint
RMVPFCST FILE(MYLIB/PERSONNEL) CST(EMPLOYEE_Department) TYPE(*REFCST) RMVCST(*RESTRICT)
This command removes the referential constraint EMPLOYEE_Department from the dependent file PERSONNEL located in the library MYLIB. Because the parent file had not yet been established (the PRNFILE had not been specified on the ADDPFCST command) the removal is not restricted.
Top |
Top |