Enforcing Data Integrity Using Check Constraints
Go Up to Customizing the Data Model
The Check constraint evaluates the data as it is entered and only if the check evaluates to true is the entry allowed. The constraint entered for an entity is used when creating the physical model and can be seen in the table's DDL.
- Double-click the entity or table you want to create a check constraint for.
- On the Rule/Constraints tab of the Entity or Table Editor, name the constraint and then enter the constraint in the text box.
The constraint is added to the CREATE TABLE statement in the Table's DDL in the format:
CONSTRAINT ( constraint_name ) CHECK ( constraint_text )
constraint_name is the name of the constraint
constraint_text is the text entered in the text box
- Constraints are created in the Data Dictionary, in the Rules folder. For more information, see Promoting Data Integrity Through Rules.