Multiple-Column Constraint Format
Use the multiple-column constraint format to associate
one or more columns with a constraint. This alternative to the single-column
constraint format allows you to associate multiple columns with a
constraint.
Element | Description | Restrictions | Syntax |
---|---|---|---|
column | Name of column or columns on which the constraint is placed | Must be unique in a table, but the same name can be in different tables of the same database | Identifier |
This is a subset of the syntax of Multiple-Column Constraint Format that the CREATE TABLE statement supports.
This alternative to the single-column constraint segment of CREATE TEMP TABLE can associate multiple columns with a constraint. Constraints that you define on temporary tables are always enabled.
The following table indicates where you can find detailed
discussions of specific constraints.
Constraint | For more information, see | For an example, see |
---|---|---|
CHECK | CHECK Clause | Defining Check Constraints Across Columns |
DISTINCT | Using UNIQUE or DISTINCT Constraints | Examples of the Multiple-Column Constraint Format |
PRIMARY KEY | Using the PRIMARY KEY Constraint | Defining Composite Primary and Foreign Keys |
UNIQUE | Using UNIQUE or DISTINCT Constraints | Examples of the Multiple-Column Constraint Format |
See also the section Differences Between a Unique Constraint and a Unique Index.