Constraint Business Rules

A constraint business rule is used to manage multiple constraints on tables and columns in a database for the DBMS that support this feature.

During generation, the variable %RULES% is evaluated in order to generate a single constraint in the SQL script. This constraint is a concatenation of all check parameters defined in the Check tab of a table property sheet, and all validation business rules applied to the current table. You can preview the result of the concatenation of checks and validation business rules in the Preview page of a table property sheet.

For more information on the check parameters of a table, see Naming a table constraint.

If you want to define distinct check constraints on tables and columns, you have to define constraint business rules and attach them to objects. This type of business rule allows to generate multiple check constraints on an object in the database.

This feature is only available for DBMS supporting multiple check constraints, and provided the EnableMultiCheck entry in the General category of the DBMS is set to Yes.

For more information on DBMS entries, see the DBMS Resource File Reference chapter in the Customizing and Extending PowerDesigner manual.

Example

Let's consider the table Project:



The following checks are defined for this table:

Check

Description

Check parameter (in the Check page of the table)

This check verifies that the customer number is different from the employee number

Validation business rule

PROJ_NUM to check that the column project number is not null

EMP_NUM to check that the employee number is not null

Constraint business rule

DATE_CONSTY to check that the start date of the project is inferior to the end date of the project

When you display the table code preview, you can verify that the check parameters and validation business rules are concatenated into a single constraint, whereas the constraint business rule is displayed as a different constraint in the script.