Difference between revisions of "SQL Constraints"

From Lianjapedia
Jump to: navigation, search
(Column Constraints)
(See Also)
Line 3: Line 3:
  
 
==See Also==
 
==See Also==
[[ALTER TABLE]], [[CREATE TABLE]], [[GRANT]], [[REVOKE]]
+
[[ALTER TABLE]], [[CREATE TABLE]], [[GRANT]], [[Lianja MetaData API]], [[REVOKE]], [[MetaData Editor|Working with MetaData]]
  
 
==Description==
 
==Description==

Revision as of 04:37, 1 July 2020

Purpose

To define rules that help to provide data integrity

See Also

ALTER TABLE, CREATE TABLE, GRANT, Lianja MetaData API, REVOKE, Working with MetaData

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

Column Constraints

AUTO_INCREMENT
AUTOSUGGESTIONS
AUTOSUGGESTIONHEADERS
AUTOINC
CALCULATED
CHECK
CHECKUNIQUE
CHOICES
DEFAULT
DESCRIPTION
ERROR
FOREIGN KEY
GETDATAMAPPING
HELP
NOCPTRANS
NOT NULL
NULL
PICTURE
PRIMARY KEY
RANGE
RECALCULATE
REFERENCES
SET CHECK
SETDATAMAPPING
UNIQUE