Defining a validation rule in the Database painter – PB Docs 2017

Defining a validation rule in the Database painter

This section describes the ways you can manipulate validation
rules in the Database painter.

To create a new validation rule

  1. 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.

  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
    .

    dwdis24b.gif

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

To modify a validation rule

  1. In the Database painter, open the Extended Attributes
    view.

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

  3. Double-click the validation rule you want to modify.

  4. 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

  1. 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.

  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 painter.

To remove a validation rule from a column in the Database
painter

  1. 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.

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

    The validation rule is no longer associated with the
    column.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x