An unnamed UNIQUE constraint on a single column or a composite UNIQUE constraint on multiple columns of the table. A UNIQUE constraint enforces the rule that no two rows in the table can have the same value in a column set. Columns must be defined as NOT NULL. Any system-defined secondary or single-table join indexes used for this constraint are included in the maximum of 32 secondary, hash, and join indexes per table. This includes the system-defined secondary indexes used to implement UNIQUE constraints for nontemporal tables and the single-table join indexes used for UNIQUE constraints on temporal tables. A UNIQUE constraint is a unique secondary index for nontemporal tables and a single-table join index for most temporal tables. UNIQUE constraints ensure the uniqueness of alternate keys. Columns with UNIQUE constraints can be used to create referential integrity relationships with other tables. For details about UNIQUE constraints on temporal tables, see Teradata Vantage™ - ANSI Temporal Table Support , B035-1186 and Teradata Vantage™ - Temporal Table Support , B035-1182 . You cannot specify UNIQUE constraints on columns with the following data types.
- BLOB
- CLOB
- ARRAY
- VARRAY
- Period
- XML
- Geospatial
- JSON
- DATASET
If the current data violates the uniqueness constraint, the system returns an error to the requestor and the table is not changed.
- CONSTRAINT constraint_name
- A named UNIQUE column constraint.