73 lines
4.3 KiB
HTML
73 lines
4.3 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="Constraints" />
|
|
<meta name="abstract" content="Constraints are rules enforced by the database manager." />
|
|
<meta name="description" content="Constraints are rules enforced by the database manager." />
|
|
<meta name="DC.subject" content="constraint, definition, unique, referential, referential integrity" />
|
|
<meta name="keywords" content="constraint, definition, unique, referential, referential integrity" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbafysqlobjects.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbafymovnow.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="rbafyconstex" />
|
|
<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>Constraints</title>
|
|
</head>
|
|
<body id="rbafyconstex"><a name="rbafyconstex"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Constraints</h1>
|
|
<div><p><dfn class="term">Constraints</dfn> are rules enforced by the database manager.</p>
|
|
<p><span class="keyword">DB2<sup>®</sup> UDB for iSeries™</span> supports the following
|
|
constraints:</p>
|
|
<ul><li>Unique constraints <p>A <dfn class="term">unique constraint</dfn> is the rule that
|
|
the values of the key are valid only if they are unique. Unique constraints
|
|
can be created using the CREATE TABLE and ALTER TABLE statements. Although
|
|
CREATE INDEX can create a unique index that also guarantees uniqueness, such
|
|
an index is not a constraint.</p>
|
|
<p>Unique constraints are enforced during
|
|
the execution of INSERT and UPDATE statements. A PRIMARY KEY constraint is
|
|
a form of UNIQUE constraint. The difference is that a PRIMARY KEY cannot contain
|
|
any nullable columns.</p>
|
|
</li>
|
|
<li>Referential constraints <p>A <dfn class="term">referential constraint</dfn> is the
|
|
rule that the values of the foreign key are valid only if: </p>
|
|
<ul><li>They appear as values of a parent key, or</li>
|
|
<li>Some component of the foreign key is null.</li>
|
|
</ul>
|
|
<p>Referential constraints are enforced during the execution of INSERT,
|
|
UPDATE, and DELETE statements.</p>
|
|
</li>
|
|
<li>Check constraints <p>A <dfn class="term">check constraint</dfn> is a
|
|
rule that limits the values allowed in a column or group of columns. Check
|
|
constraints can be added using the CREATE TABLE and ALTER TABLE statements.
|
|
Check constraints are enforced during the execution of INSERT and UPDATE statements.
|
|
To satisfy the constraint, each row of data inserted or updated in the table
|
|
must make the specified condition either TRUE or unknown (due to a null value).</p>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafysqlobjects.htm" title="SQL objects are schemas, journals, catalogs, tables, aliases, views, indexes, constraints, triggers, sequences, stored procedures, user-defined functions, user-defined types, and SQL packages. SQL creates and maintains these objects as system objects.">SQL objects</a></div>
|
|
</div>
|
|
<div class="relref"><strong>Related reference</strong><br />
|
|
<div><a href="rbafymovnow.htm" title="DB2 UDB for iSeries supports unique, referential, and check constraints.">Constraints</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |