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.
This syntax fragment is part of the CREATE TABLE statement and the OF TYPE Clause.
Multiple-Column Constraint Format
Notes:
- 1 Informix® extension
- 2 See REFERENCES Clause
- 3 See CHECK Clause
- 4 See Constraint Definition
| Element | Description | Restrictions | Syntax |
|---|---|---|---|
| column | Columns on which to place constraint | Not BYTE, TEXT, BLOB, CLOB | Identifier |
A multiple-column
constraint has these cardinality and size restrictions:
- It can specify no more than 16 column names.
- In Informix®, the maximum total length of the
list of columns depends on the page size:
- For page size of 2K, the total length cannot exceed 380 bytes.
- For page size of 16K, the total length cannot exceed 3247 bytes.
- A page size of 256K will support a total length of 32K, which is the maximum row size.
When you define a unique constraint (by using the UNIQUE or DISTINCT keyword), a column cannot appear in the constraint list more than once.
Using the multiple-column constraint format, you can perform
these tasks:
- Create data-integrity constraints for a set of one or more columns
- Declare a mnemonic name for a constraint
- Specify the constraint-mode option that controls the behavior of a constraint during insert, delete, and update operations.
When you use this format, you can create composite primary and foreign keys, or define check constraints that compare data in different columns.
See also the section Differences Between a Unique Constraint and a Unique Index.