Scalable Database Server, HiRDB Version 8 Description

[Contents][Glossary][Index][Back][Next]

5.6.2 Uniqueness constraint

You can define the uniqueness constraint for a column, and thereby prohibit duplication of data in the column (each data entry in the column must be unique). When the uniqueness constraint is defined for a column, a row cannot be added if it contains a nonunique value in that column, nor can a row be updated so as to set a nonunique value in that column. Because columns for which the uniqueness constraint is defined are always required to have unique values, an attempt to assign a non-unique value to such a column results in a constraint violation. The uniqueness constraint can be specified for the following columns:

The uniqueness constraint is set for a column for which a cluster key is defined by specifying the UNIQUE CLUSTER KEY option in the CREATE TABLE statement. Similarly, the uniqueness constraint is set for a column for which an index key is defined by specifying the UNIQUE option in the CREATE INDEX statement. For details about the uniqueness constraint, see the HiRDB Version 8 UAP Development Guide.

Comment
The uniqueness constraint is applied to columns for which the primary key is defined.