86 lines
7.1 KiB
HTML
86 lines
7.1 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE html
|
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html lang="en-us" xml:lang="en-us">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta name="security" content="public" />
|
|
<meta name="Robots" content="index,follow" />
|
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
|
<meta name="DC.Type" content="concept" />
|
|
<meta name="DC.Title" content="Ensure data integrity with referential constraints" />
|
|
<meta name="abstract" content="These topics discuss how to use referential constraints in your database to ensure that it contains only valid data." />
|
|
<meta name="description" content="These topics discuss how to use referential constraints in your database to ensure that it contains only valid data." />
|
|
<meta name="DC.subject" content="referential constraints, ensuring data integrity" />
|
|
<meta name="keywords" content="referential constraints, ensuring data integrity" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbafomanage.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbaforzahfrce.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbaforzahfrco.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbaforzahfrcy.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbaforzahfrc0.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbaforzahfrcb.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbaforzahfrcd.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbaforzahfrcc.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbaforzahfrcp.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbaforzahfrcu.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbaforzahfrcv.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbaforzahfrc3.htm" />
|
|
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
|
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
|
|
<meta name="DC.Format" content="XHTML" />
|
|
<meta name="DC.Identifier" content="rbaforzahfrca" />
|
|
<meta name="DC.Language" content="en-us" />
|
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
|
<!-- US Government Users Restricted Rights -->
|
|
<!-- Use, duplication or disclosure restricted by -->
|
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
|
<title>Ensure data integrity with referential constraints</title>
|
|
</head>
|
|
<body id="rbaforzahfrca"><a name="rbaforzahfrca"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Ensure data integrity with referential constraints</h1>
|
|
<div><p>These topics discuss how to use referential constraints
|
|
in your database to ensure that it contains only valid data.</p>
|
|
<p>You can use referential constraints in <span class="keyword">iSeries™</span> databases
|
|
to enforce the referential integrity of your system. Referential integrity
|
|
encompasses all of the mechanisms and techniques that you use to make sure
|
|
that your database contains only valid data.</p>
|
|
</div>
|
|
<div>
|
|
<ul class="ullinks">
|
|
<li class="ulchildlink"><strong><a href="rbaforzahfrce.htm">Add referential constraints</a></strong><br />
|
|
You can add referential constraints on physical files with no more than one member. A referential constraint is a file-level attribute; therefore, you can create the constraint before the member exists.</li>
|
|
<li class="ulchildlink"><strong><a href="rbaforzahfrco.htm">Verify referential constraints</a></strong><br />
|
|
The system automatically verifies the validity of a referential constraint when you add the constraint with the Add Physical File Constraint (ADDPFCST) command. The system verifies that every non-null value in the foreign key matches a corresponding value in the parent key.</li>
|
|
<li class="ulchildlink"><strong><a href="rbaforzahfrcy.htm">Enable or disable referential constraints</a></strong><br />
|
|
You can enable or disable a referential constraint using the Change
|
|
Physical File Constraint (CHGPFCST) command or iSeries Navigator.</li>
|
|
<li class="ulchildlink"><strong><a href="rbaforzahfrc0.htm">Remove referential constraints</a></strong><br />
|
|
You can remove referential constraints in various ways. The full impact of the removal depends on the constraint you are removing and the certain conditions that surround the constraint.</li>
|
|
<li class="ulchildlink"><strong><a href="rbaforzahfrcb.htm">Details: Ensure data integrity with referential constraints</a></strong><br />
|
|
You might want to use referential integrity in your database management system for several reasons.</li>
|
|
<li class="ulchildlink"><strong><a href="rbaforzahfrcd.htm">Example: Ensure data integrity with referential constraints</a></strong><br />
|
|
Here is an example of how to ensure data integrity with referential constraints.</li>
|
|
<li class="ulchildlink"><strong><a href="rbaforzahfrcc.htm">Referential integrity terms</a></strong><br />
|
|
A discussion of referential integrity requires an understanding of several terms. These terms are in an order that might help you understand their relationship to each other.</li>
|
|
<li class="ulchildlink"><strong><a href="rbaforzahfrcp.htm">Referential integrity enforcement</a></strong><br />
|
|
The input/output (I/O) access for files that are associated with established and enabled constraints varies. It depends on whether the file contains the parent key or foreign key in the constraint relationship. The system enforces referential integrity enforcement on all parent and dependent file I/O requests.</li>
|
|
<li class="ulchildlink"><strong><a href="rbaforzahfrcu.htm">Constraint states</a></strong><br />
|
|
A file can be in one of three constraint states. In two of the states, the constraint can be enabled or disabled.</li>
|
|
<li class="ulchildlink"><strong><a href="rbaforzahfrcv.htm">Check pending status in referential constraints</a></strong><br />
|
|
<em>Check pending</em> is the condition of a constraint relationship
|
|
when potential mismatches exist between parent and foreign keys. When the
|
|
system determines that referential integrity might have been violated, the
|
|
constraint relationship is marked as check pending.</li>
|
|
<li class="ulchildlink"><strong><a href="rbaforzahfrc3.htm">Referential integrity and CL commands</a></strong><br />
|
|
Referential integrity affects the characteristics of some CL commands.</li>
|
|
</ul>
|
|
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafomanage.htm" title="These topics discuss how to maintain control of database files on your system by managing the files, their descriptions and attributes. Information about how to maintain control over your data to protect it from loss, how to ensure data integrity with constraints, and how to set up trigger events when the data changes is included.">Manage database files</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |