Unique (Index Keyword)
Usage
To specify that InterSystems IRIS should enforce uniqueness for the properties on which this index is based, use the following syntax:
Index name On property_expression_list [ Unique ];
Where:
-
name is the name of the index. It is useful to follow a naming convention so that indexes can be easily distinguished from properties. For example, you could include IDX at the end of all index names.
-
property_expression_list is either a single property name or a comma-separated list of properties, enclosed in parentheses.
Otherwise, omit this keyword or place the word Not immediately before the keyword.
Details
The Unique keyword, if present, indicates that this is a unique index.
The property (or properties) indexed by a unique index are constrained to have unique values (that is, no two instances can have the same collated value) within the extent (set of all objects) of the class (table) that defines the index.
A unique index cannot also be a bitmap index.
For a unique index, InterSystems IRIS generates methods that you can use to open objects, check existence of objects, and delete objects; see Open, Exists, and Delete Methods.
Example
Index SSNIdx On SSN [ Unique ] ;
Default
If you omit this keyword, InterSystems IRIS does not enforce uniqueness for the properties on which this index is based.