Defining a validation rule in the Database painter
Contents
This section describes the ways you can manipulate validation
rules in the Database painter.
To create a new validation rule
-
In the Extended Attributes view in the Database painter,
right-click Validation Rules and select New from the pop-up
menu.The Validation Rule view displays in the Properties
view. -
Assign a name to the rule, select the datatype of the
columns to which it applies, and customize the error message (if
desired).For information, see Customizing the
error message. -
Click the Definition tab and define the expression for the
rule.For information, see Defining the
expression.You can use this rule with any column of the appropriate
datatype in the database.
To modify a validation rule
-
In the Database painter, open the Extended Attributes
view. -
In the Extended Attributes view, open the list of validation
rules. -
Double-click the validation rule you want to modify.
-
In the Validation Rule view, modify the validation rule as
desired.For information, see Defining the
expression and Customizing the
error message.
To associate a validation rule with a column in the Database
painter
-
In the Database painter (Objects view), position the pointer
on the column, select Properties from the column’s pop-up menu,
and select the Validation tab. -
Select a validation rule from the Validation Rule drop-down
list.The column now has the selected validation rule associated
with it in the extended attribute system tables. Whenever you use
this column in a DataWindow object, it will use this validation
rule unless you override it in the DataWindow painter.
To remove a validation rule from a column in the Database
painter
-
In the Database painter (Objects view), position the pointer
on the column, select Properties from its pop-up menu, and select
the Validation tab in the Properties view. -
Select (None) from the list in the Validation Rule drop-down
list.The validation rule is no longer associated with the
column.