Contents Index Using table and column constraints Using CHECK constraints on tables

ASA SQL User's Guide
  Ensuring Data Integrity
    Using table and column constraints

Using CHECK constraints on columns


You use a CHECK condition to ensure that the values in a column satisfy some definite criterion or rule. For example, these rules or criteria may simply be required for data to be reasonable, or they may be more rigid rules that reflect organization policies and procedures.

CHECK conditions on individual column values are useful when only a restricted range of values are valid for that column.

Example 1 
Example 2 
Example 3 

Column CHECK tests only fail if the condition returns a value of FALSE. If the condition returns a value of UNKNOWN, the change is allowed.


Contents Index Using table and column constraints Using CHECK constraints on tables