Difference between revisions of "SQL Constraints"
From Recital Documentation Wiki
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
Line 23: | Line 23: | ||
|[[CHECK Table Constraint|CHECK]]||[[ERROR Table Constraint|ERROR]]||[[FOREIGN KEY Table Constraint|FOREIGN KEY]] | |[[CHECK Table Constraint|CHECK]]||[[ERROR Table Constraint|ERROR]]||[[FOREIGN KEY Table Constraint|FOREIGN KEY]] | ||
|- | |- | ||
− | |INDEX Table Constraint||KEY Table Constraint||ONCLOSE Table Constraint | + | |[[INDEX Table Constraint|INDEX]]||[[KEY Table Constraint|KEY]]||[[ONCLOSE Table Constraint|ONCLOSE]] |
|- | |- | ||
− | |ONDELETE Table Constraint||ONINSERT Table Constraint||ONOPEN Table Constraint | + | |[[ONDELETE Table Constraint|ONDELETE]]||[[ONINSERT Table Constraint|ONINSERT]]||[[ONOPEN Table Constraint|ONOPEN]] |
|- | |- | ||
− | |ONROLLBACK Table Constraint||ONUPDATE Table Constraint||PRIMARY KEY Table Constraint | + | |[[ONROLLBACK Table Constraint|ONROLLBACK]]||[[ONUPDATE Table Constraint|ONUPDATE]]||[[PRIMARY KEY Table Constraint|PRIMARY KEY]] |
|- | |- | ||
− | |UNIQUE Table Constraint|||| | + | |[[UNIQUE Table Constraint|UNIQUE]]|||| |
|- | |- | ||
|} | |} | ||
Line 38: | Line 38: | ||
{| class="wikitable" | {| class="wikitable" | ||
− | + | |[[AUTO_INCREMENT Column Constraint|AUTO_INCREMENT]]||[[AUTOINC Column Constraint|AUTOINC]]||[[CALCULATED Column Constraint|CALCULATED]] | |
|- | |- | ||
− | |CHECK||DEFAULT||DESCRIPTION | + | |[[CHECK Column Constraint|CHECK]]||[[DEFAULT Column Constraint|DEFAULT]]||[[DESCRIPTION Column Constraint|DESCRIPTION]] |
|- | |- | ||
− | |ERROR||FOREIGN KEY||NOCPTRANS | + | |[[ERROR Column Constraint|ERROR]]||[[FOREIGN KEY Column Constraint|FOREIGN KEY]]||[[NOCPTRANS Column Constraint|NOCPTRANS]] |
|- | |- | ||
− | |NOT NULL||NULL||PRIMARY KEY | + | |[[NOT NULL Column Constraint|NOT NULL]]||[[NULL Column Constraint|NULL]]||[[PRIMARY KEY Column Constraint|PRIMARY KEY]] |
|- | |- | ||
− | |RANGE||RECALCULATE||REFERENCES | + | |[[RANGE Column Constraint|RANGE]]||[[RECALCULATE Column Constraint|RECALCULATE]]||[[REFERENCES Column Constraint|REFERENCES]] |
|- | |- | ||
− | |SET CHECK||UNIQUE|| | + | |[[SET CHECK Column Constraint|SET CHECK]]||[[UNIQUE Column Constraint|UNIQUE]]|| |
|- | |- | ||
|} | |} |
Revision as of 17:06, 19 March 2009
Contents
CONSTRAINTS
Class
SQL Applications
Purpose
To define rules that help to provide data integrity
See Also
ALTER TABLE, CREATE TABLE, GRANT, REVOKE
Description
A constraint is used to define rules that help to provide data integrity. There are two different types of constraints, TABLE constraints, which do not require any column information and column constraints, which are specific to the column name specified. You must have ALTER privilege on the table. The table will be locked for EXCLUSIVE use during the operation.
Table Constraints
CHECK | ERROR | FOREIGN KEY |
INDEX | KEY | ONCLOSE |
ONDELETE | ONINSERT | ONOPEN |
ONROLLBACK | ONUPDATE | PRIMARY KEY |
UNIQUE |
Column Constraints
AUTO_INCREMENT | AUTOINC | CALCULATED |
CHECK | DEFAULT | DESCRIPTION |
ERROR | FOREIGN KEY | NOCPTRANS |
NOT NULL | NULL | PRIMARY KEY |
RANGE | RECALCULATE | REFERENCES |
SET CHECK | UNIQUE |
Products
Recital Database Server, Recital Mirage Server, Recital Terminal Developer