RemoveByKey(CheckKey: Integer): Boolean;
CheckKey is constraint key.
The RemoveByKey method removes a table constraint. The index key is passed by the TriggerKey parameter.
Sub Main;
Var
MB: IMetabase;
Object: IMetabaseObject;
Table: ITable;
Checks: ITableChecks;
s: String;
Begin
MB:=MetabaseClass.Active;
Object:=MB.ItemById("TABLE_1").Edit;
Table:=Object As ITable;
Checks:=Table.Checks;
If Checks.RemoveByKey(10) Then
s:="Removed";
Else
s:="Don't Removed";
End If;
Object.Save;
End Sub Main;
After executing the example, the "s" variable contains Removed, if removal of the table constraint with the key 10 was successful. The table identifier is Table_1.
See also: