Defining a validation rule in the Enterprise Explorer

This section describes the ways you can manipulate validation rules in the Enterprise Explorer.

StepsTo create a new validation rule

  1. In the Enterprise Explorer, select View>Extended Attributes from the Enterprise Explorer view drop-down menu. In the Extended Attributes view, select Display Formats.

    The Validation Rule view displays in the Properties view.

  2. 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”.

  3. Click the Definition tab and define the expression for the rule.

    For information, see “Defining the expression”.

    The sample shows the Validation Rule view open at the Definition tab. It displays buttons you can click to select Match or to paste @ col into the Validation Rule area at the bottom of the view. Also listed are the Functions you paste there.

You can use this rule with any column of the appropriate datatype in the database.

StepsTo modify a validation rule:

  1. In the Enterprise Explorer, select View>Extended Attributes from the Enterprise Explorer view drop-down menu to open the Extended Attributes view.

  2. In the Extended Attributes view, open the list of validation rules.

  3. Position the pointer on the validation rule you want to modify, display the pop-up menu, and select Properties.

  4. In the Validation Rule view, modify the validation rule as desired.

    For information, see “Defining the expression” and “Customizing the error message”.

StepsTo associate a validation rule with a column in the Enterprise Explorer:

  1. In the Enterprise Explorer (Objects view), position the pointer on the column, select Properties from the column’s pop-up menu, and select the Validation tab.

  2. 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 editor.

StepsTo remove a validation rule from a column in the Enterprise Explorer:

  1. In the Enterprise Explorer (Objects view), position the pointer on the column, select Properties from its pop-up menu, and select the Validation tab in the Properties view.

  2. Select (None) from the list in the Validation Rule drop-down list.

    The validation rule is no longer associated with the column.