Check constraint: Difference between revisions

Content deleted Content added
Stolze (talk | contribs)
External link: Used DB2 V9 link
Added info about NOT NULL constraints
Line 31:
...
)
 
==NOT NULL Constraint==
A NOT [[Null (SQL)|NULL]] constraint is functionally equivalent to the following check constraint with an <code>IS NOT NULL</code> predicate:
 
CHECK (''column'' IS NOT NULL)
 
Some [[Relational database management system|relational database management systems]] are able to optimize performance when the <code>NOT NULL</code> constraint syntax is used as opposed to the CHECK constraint syntax given above.<ref>PostgreSQL 8.3devel Documentation, Chapter 5. ''Data Definition'', Section 5.3.2. ''Not-Null Constraints'', Website: http://developer.postgresql.org/pgdocs/postgres/ddl-constraints.html, Accessed on May 5, 2007</ref>
 
== Common Restrictions ==
 
Most database management systems restrict check constraints to a single row. References to data stored in other tables is not allowed. At most constants and deterministic functions (that do not refer to other tables) are supported. Such constraints are not truly ''table check constraints'' but rather ''row check constraints''. [[Database trigger|Triggers]] can be used to work around this restriction.
 
== References ==
<references/>
 
== External Links ==