ITableForeignKeys.Remove

Syntax

Remove(ForeignKey: Integer): Boolean;

Parameters

ForeignKey. Index of the external key to be removed.

Description

The Remove method removes an external key with specified index from collection.

Comments

Indexation of external keys in the collection is continuous and starts with zero. The ITableForeignKeys.Count property returns the number of external keys in collection.

Example

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

Add links to the Metabase, Db system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    Table: ITable;
    FKeys: ITableForeignKeys;
    Key: ITableForeignKey;
Begin
    mb := MetabaseClass.Active;
    Table := mb.ItemById("TABLE_L").Edit As ITable;
    FKeys := Table.ForeignKeys;
    If FKeys.Count > 0 Then
        Debug.WriteLine(FKeys.Remove(0));
    End If;
    (Table As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the first external key is removed from the TABLE_L table.

See also:

ITableForeignKeys