Show contents 

Db > Db Assembly Interfaces > ITable > ITable.Checks

ITable.Checks

Syntax

Checks: ITableChecks;

Description

The Checks property returns table restrictions.

Example

Executing the example requires that the repository contains a table with the TABLE_1 identifier. The table contains a numeric field with the NUM_FIELD identifier.

Sub UserProc;
Var
    MB: IMetabase;
    Object: IMetabaseObject;
    Table: ITable;
    Checks: ITableChecks;
    Check: ITableCheck;
Begin
    MB := MetabaseClass.Active;
    Object := MB.ItemById("TABLE_1").Edit;
    Table := Object As ITable;
    Checks := Table.Checks;
    Check := Checks.Add;
    Check.Id := "CheckX";
    Check.Name := "Constraint of number field value";
    Check.Text := "ABS(NUM_FIELD)<100";
    Object.Save;
End Sub UserProc;

After executing the example, a new constraint is created in the table. The constraint checks the absolute value of the NUM_FIELD numeric field.

See also:

ITable