User Guide : 6. Working with Databases : Using Rules : Create a Rule
 
Share this page                  
Create a Rule
Rules can be defined against base tables and against views if the view is updatable. Rules reference procedures, which must be created first. For more information, see Create a Procedure.
Before you can create a rule, the Ingres installation containing the database must be connected in the Instance Explorer (see Connect to an Actian Database Instance).
Note:  Rules cannot be created for Actian Vector tables.
For more information about creating rules, see the create rule command in the Ingres SQL Reference Guide.
To create a rule
1. In the Instance Explorer, expand the database and table for which you want to create the rule.
2. Under the expanded table node, right-click on the Rules folder and select New Rule from the context menu.
The New Rule dialog opens (see New Rule Dialog).
3. Define a name for the rule (see Object Naming Rules).
4. Select a table for which to create the rule.
5. Select when to fire the rule.
6. Select the type of statement that triggers execution of the rule (Insert, Delete, Update).
7. If you selected the Update trigger, click the Columns button, and choose specific columns to update.
8. Specify any qualifications (where clauses) to include in the create rule statement.
9. Choose at what level to apply the rule (Row or Statement).
10. Select the procedure to execute when a statement triggers the rule. If the procedure has parameters, click Parameters and set values for the parameters.
11. Click OK to create the rule.
The rule is created and stored in the Rules folder.