ITableIndexes.Add

Syntax

Add: ITableIndex;

Description

The Add method adds table index.

Example

Executing the example requires that the repository contains a table with the TABLE_1 identifier.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    Table: ITable;
    Indexes: ITableIndexes;
    Index: ITableIndex;
Begin
    MB:=MetabaseClass.Active;
    MObj:=MB.ItemById("TABLE_1").Edit;
    Table:=MObj As ITable;
    Indexes:=Table.Indexes;
    Index:=Indexes.Add;
    Index.Fields.Add(Table.Fields.Item(0));
    MObj.Save;
End Sub UserProc;

After executing the example, the index by the first field is created in the table.

See also:

ITableIndexes