Difference between revisions of "SQL Constraints"
From Lianjapedia
Yvonne.milne (Talk | contribs) |
Yvonne.milne (Talk | contribs) (→Column Constraints) |
||
Line 63: | Line 63: | ||
|- | |- | ||
|[[FOREIGN KEY Column Constraint|FOREIGN KEY]] | |[[FOREIGN KEY Column Constraint|FOREIGN KEY]] | ||
+ | |- | ||
+ | |[[GETDATAMAPPING Column Constraint|GETDATAMAPPING]] | ||
|- | |- | ||
|[[HELP Column Constraint|HELP]] | |[[HELP Column Constraint|HELP]] | ||
Line 83: | Line 85: | ||
|- | |- | ||
|[[SET CHECK Column Constraint|SET CHECK]] | |[[SET CHECK Column Constraint|SET CHECK]] | ||
+ | |- | ||
+ | |[[SETDATAMAPPING Column Constraint|SETDATAMAPPING]] | ||
|- | |- | ||
|[[UNIQUE Column Constraint|UNIQUE]] | |[[UNIQUE Column Constraint|UNIQUE]] |
Revision as of 11:05, 23 March 2018
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 |
ONAFTERDELETE |
ONAFTERINSERT |
ONAFTERUPDATE |
ONCLOSE |
ONBEFOREDELETE / ONDELETE |
ONBEFOREINSERT / ONINSERT |
ONOPEN |
ONBEFOREUPDATE / ONUPDATE |
PRIMARY KEY |
UNIQUE |