Show contents 

Db > Db Assembly Interfaces > ITableIndex > ITableIndex.Unique

ITableIndex.Unique

Syntax

Unique: Boolean;

Description

The Unique property determines whether an index is unique.

Example

Executing the example requires that the repository contains a table with the Table_1 identifier. The table contains at least two fields.

Sub UserProc;
Var
    MB: IMetabase;
    Table: ITable;
    Fields: ITableFields;
    Index: ITableIndex;
Begin
    MB := MetabaseClass.Active;
    Table := MB.ItemById("Table_1").Edit As ITable;
    Fields := Table.Fields;
    Index := Table.Indexes.Add;
    Index.Fields.Add(Fields.Item(0));
    Index.Fields.Add(Fields.Item(1));
    Index.Unique := True;
    (Table As IMetabaseObject).Save;
End Sub UserProc;

After executing the example, the unique index is created in the table. The index is created by two first fields of the table.

See also:

ITableIndex