ibm-information-center/dist/eclipse/plugins/i5OS.ic.cl_5.4.0.1/rmvpfcst.htm

298 lines
11 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><META http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Remove PF Constraint (RMVPFCST)</title>
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body bgcolor="white">
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<a name="RMVPFCST.Top_Of_Page"></a>
<h2>Remove PF Constraint (RMVPFCST)</h2>
<table width="100%">
<tr>
<td valign="top" align="left"><b>Where allowed to run: </b>All environments (*ALL)<br>
<b>Threadsafe: </b>Conditional
</td>
<td valign="top" align="right">
<a href="#RMVPFCST.PARAMETERS.TABLE">Parameters</a><br>
<a href="#RMVPFCST.COMMAND.EXAMPLES">Examples</a><br>
<a href="#RMVPFCST.ERROR.MESSAGES">Error messages</a></td>
</tr>
</table>
<div> <a name="RMVPFCST"></a>
<p>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.
</p>
<p><b>Restrictions:</b>
</p>
<ul>
<li>You must have object management (*OBJMGT) or object alter (*OBJALTER) authority to the physical file specified for the <b>File (FILE)</b> parameter.
</li>
<li>You must have execute (*EXECUTE) authority to the library that contains the physical file.
</li>
<li>You cannot remove a constraint relationship from a file that your user job has open.
</li>
<li>This command is conditionally threadsafe. In multithreaded jobs, this command is not threadsafe for distributed files and fails for distributed files that use relational databases of type *SNA.
</li>
</ul>
</div>
<table width="100%">
<tr><td align="right"><a href="#RMVPFCST.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div>
<h3><a name="RMVPFCST.PARAMETERS.TABLE">Parameters</a></h3>
<table border="1" cellpadding="4" cellspacing="0">
<!-- col1="10" col2="15" col3="30" col4="10" -->
<tr>
<th bgcolor="aqua" valign="bottom" align="left">Keyword</th>
<th bgcolor="aqua" valign="bottom" align="left">Description</th>
<th bgcolor="aqua" valign="bottom" align="left">Choices</th>
<th bgcolor="aqua" valign="bottom" align="left">Notes</th>
</tr>
<tr>
<td valign="top" rowspan="3"><a href="#RMVPFCST.FILE"><b>FILE</b></a></td>
<td valign="top">File</td>
<td valign="top"><i>Qualified object name</i></td>
<td valign="top" rowspan="3">Required, Positional 1</td>
</tr>
<tr>
<td valign="top">Qualifier 1: File</td>
<td valign="top"><i>Name</i></td>
</tr><tr>
<td valign="top">Qualifier 2: Library</td>
<td valign="top"><i>Name</i>, <b><u>*LIBL</u></b>, *CURLIB</td>
</tr><tr>
<td valign="top"><a href="#RMVPFCST.CST"><b>CST</b></a></td>
<td valign="top">Constraint name</td>
<td valign="top">Single values: *ALL, *CHKPND<br>Other values (up to 300 repetitions): <i>Character value</i></td>
<td valign="top">Required, Positional 2</td>
</tr>
<tr>
<td valign="top"><a href="#RMVPFCST.TYPE"><b>TYPE</b></a></td>
<td valign="top">Constraint type</td>
<td valign="top"><b><u>*ALL</u></b>, *REFCST, *UNQCST, *PRIKEY, *CHKCST</td>
<td valign="top">Optional, Positional 3</td>
</tr>
<tr>
<td valign="top"><a href="#RMVPFCST.RMVCST"><b>RMVCST</b></a></td>
<td valign="top">Remove constraint</td>
<td valign="top"><b><u>*RESTRICT</u></b>, *REMOVE, *KEEP</td>
<td valign="top">Optional</td>
</tr>
</table>
<table width="100%">
<tr><td align="right"><a href="#RMVPFCST.Top_Of_Page">Top</a></td></tr>
</table>
</div>
<div> <a name="RMVPFCST.FILE"></a>
<h3>File (FILE)</h3>
<p>Specifies the physical file from which a constraint is to be removed. For a referential constraint, this file can be a dependent file only.
</p>
<p>This is a required parameter.
</p>
<p><b>Qualifier 1: File</b>
</p>
<dl>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the physical file.
</dd>
</dl>
<p><b>Qualifier 2: Library</b>
</p>
<dl>
<dt><b><u>*LIBL</u></b></dt>
<dd>All libraries in the library list for the current thread are searched until the first match is found.
</dd>
</dl>
<dl>
<dt><b>*CURLIB</b></dt>
<dd>The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
</dd>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the library to be searched.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RMVPFCST.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RMVPFCST.CST"></a>
<h3>Constraint name (CST)</h3>
<p>Specifies the name of the constraint relationship being removed.
</p>
<p>This is a required parameter.
</p>
<p><b>Single values</b>
</p>
<dl>
<dt><b>*ALL</b></dt>
<dd>All of the constraint relationships for the file specified on the FILE parameter are removed.
</dd>
<dt><b>*CHKPND</b></dt>
<dd>The constraint relationships that have records that are possibly in violation of the constraints (check pending) are removed. A <b>check pending</b> state occurs when the system has not yet determined that the values of a dependent file are all valid in relation to its parent key or record values for the check constraint expression are valid. Only referential and check constraints can be in check pending.
</dd>
</dl>
<p><b>Other values (up to 300 repetitions)</b>
</p>
<dl>
<dt><b><i>character-value</i></b></dt>
<dd>Specify the name of the constraint.
<p>
<b>Note: </b>The case is preserved when lowercase characters are specified.
</p>
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RMVPFCST.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RMVPFCST.TYPE"></a>
<h3>Constraint type (TYPE)</h3>
<p>Specifies the type of constraint relationship named on the CST parameter that is being removed from the physical file.
</p>
<dl>
<dt><b><u>*ALL</u></b></dt>
<dd>All types of primary key and unique constraints are removed. The following are examples of the CST parameter dependencies:
<ul>
<li>CST(*ALL) TYPE(*ALL) - All constraints are removed
</li>
<li>CST(*CHKPND) TYPE(*ALL) - All referential and check constraints in check pending are removed
</li>
<li>CST(ABC) TYPE(*ALL) - The constraint ABC is removed
</li>
</ul>
<p>
<b>Note: </b>This value is ignored for referential constraints when the RMVCST parameter is specified.
</p>
</dd>
<dt><b>*REFCST</b></dt>
<dd>The referential constraints are removed. The following are examples of the CST parameter dependencies:
<ul>
<li>CST(*ALL) TYPE(*REFCST) - All referential constraints are removed
</li>
<li>CST(*CHKPND) TYPE(*REFCST) - All referential constraints in check pending are removed
</li>
<li>CST(ABC) TYPE(*REFCST) - The referential constraint ABC is removed
</li>
</ul>
</dd>
<dt><b>*UNQCST</b></dt>
<dd>The unique constraints are removed.
<p>
<b>Note: </b>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.
</p>
<p>The following are examples of the CST parameter dependencies:
</p>
<ul>
<li>CST(*ALL) TYPE(*UNQCST) - All unique constraints (except the primary key constraint) are removed
</li>
<li>CST(*CHKPND) TYPE(*UNQCST) - Not valid; unique constraints cannot be in check pending
</li>
<li>CST(ABC) TYPE(*UNQCST) - The unique constraint ABC is removed (unless it is a primary key constraint)
</li>
</ul>
</dd>
<dt><b>*PRIKEY</b></dt>
<dd>The primary key constraint is removed. The following are examples of the CST parameter dependencies:
<ul>
<li>CST(*ALL) TYPE(*PRIKEY) - The primary key constraint is removed
</li>
<li>CST(*CHKPND) TYPE(*PRIKEY) - Not valid; primary key constraints cannot be in check pending
</li>
<li>CST(ABC) TYPE(*PRIKEY) - The primary key constraint ABC is removed
</li>
</ul>
</dd>
<dt><b>*CHKCST</b></dt>
<dd>The check constraints are removed. The following are examples of the CST parameter dependencies:
<ul>
<li>CST(*ALL) TYPE(*CHKCST) - All check constraints are removed
</li>
<li>CST(*CHKPND) TYPE(*CHKCST) - All check constraints in check pending are removed
</li>
<li>CST(XYZ) TYPE(*CHKCST) - The check constraint XYZ is removed
</li>
</ul>
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RMVPFCST.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RMVPFCST.RMVCST"></a>
<h3>Remove constraint (RMVCST)</h3>
<p>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.
</p>
<p>
<b>Note: </b>This parameter is ignored if *REFCST is specified for the <b>Constraint type (TYPE)</b> parameter.
</p>
<dl>
<dt><b><u>*RESTRICT</u></b></dt>
<dd>The constraint is not removed if the constraint is either defined or established between the parent file and the dependent file. Neither the foreign key access path nor the foreign key of the dependent file is removed.
</dd>
<dt><b>*REMOVE</b></dt>
<dd>The constraint and the constraint definition between the parent file and the dependent file are removed. The corresponding foreign key is removed. The foreign key access path of the dependent file is removed only if one exists and is not shared.
</dd>
<dt><b>*KEEP</b></dt>
<dd>The constraint between the parent file and the dependent file is removed, but the constraint definition is not removed. The corresponding foreign key and the foreign key access path of the dependent file are not removed.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RMVPFCST.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="RMVPFCST.COMMAND.EXAMPLES">Examples</a> </h3>
<p>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:
</p>
<p>
<pre>
ADDPFCST FILE(MYLIB/DEPARTMENTS) TYPE(*UNQCST)
KEY(DEPTNUM) CST(UNIQUE_Department_NUMBER)
ADDPFCST FILE(MYLIB/PERSONNEL) TYPE(*REFCST) KEY(DEPTNO)
CST(EMPLOYEE_Department)
</pre>
</p>
<p><b>Example 1: Removing a Unique Constraint</b>
</p>
<p>
<pre>
RMVPFCST FILE(MYLIB/DEPARTMENTS) CST(*ALL) TYPE(*ALL)
</pre>
</p>
<p>This command removes the unique constraint UNIQUE_Department_NUMBER from the file DEPARTMENTS located in the library MYLIB.
</p>
<p><b>Example 2: Removing a Referential Constraint</b>
</p>
<p>
<pre>
RMVPFCST FILE(MYLIB/PERSONNEL) CST(EMPLOYEE_Department)
TYPE(*REFCST) RMVCST(*RESTRICT)
</pre>
</p>
<p>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.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#RMVPFCST.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="RMVPFCST.ERROR.MESSAGES">Error messages</a> </h3>
<p><b><u>*ESCAPE Messages</u></b>
</p>
<dl>
<dt><b>CPF32B1</b></dt>
<dd>Constraint(s) not removed from file &amp;1.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RMVPFCST.Top_Of_Page">Top</a></td></tr>
</table>
</body>
</html>