HP 3000 Manuals

GENERATE RULES [ ALLBASE/SQL Database Administration Guide ] MPE/iX 5.5 Documentation


ALLBASE/SQL Database Administration Guide

GENERATE RULES 

Generates SQL commands to recreate one or more rules in a DBEnvironment.

Scope 

SQLGEN only

SQLGEN Syntax 

>> [GEN[ERATE]] RULE[S]  Schema File Name or '//' to STOP command >>

SchemaFileName  Owner Name >> OwnerName  Do you wish to specify Rule

Names for each Owner (n/y)?  {N[O] }  Rule Name for Owner OwnerName >>
                             {Y[ES]}

RuleName 

Parameters 

SchemaFileName          is the name of the schema file where SQLGEN
                        places generated commands.

OwnerName               is the name of the owner whose rules you wish to
                        generate.

NO or YES               respond NO to select all rules for the owner;
                        respond YES to select certain rules for the
                        owner.

RuleName                is the name of a rule you wish to generate.

Description 

   *   GENERATE RULES builds CREATE RULE commands to recreate one or more
       rules in the DBEnvironment.

Example 

     >> generate rules 

     ALLBASE/SQL Command Generator for Rules

     Schema File Name or '//' to STOP command >> partrschema 

     Please enter Owner Names.  Type @ for all, ? for a list of
     Owner Names, or RETURN to quit.

     Owner Name >> PurchDB 
     Do you wish to specify Rule Names for each Owner (n/y)? n 

     Generating command to CREATE RULE PURCHDB.INSERTREPORT
     Generating command to CREATE RULE PURCHDB.UPDATEREPORT
     Generating command to CREATE RULE PURCHDB.DELETEREPORT

     Owner Name >> Return 

     >>

Schema File Produced 

     /* This file was created with a user language environment of */
     /*    NATIVE-3000                                            */

     CREATE RULE PURCHDB.INSERTREPORT
     AFTER INSERT
      ON PURCHDB.REPORTS
     execute procedure PurchDB.ReportMonitor (NEW.ReportName,
     NEW.ReportOwner, 'INSERT');

     CREATE RULE PURCHDB.UPDATEREPORT
     AFTER UPDATE(REPORTOWNER,REPORTNAME)
      ON PURCHDB.REPORTS
     execute procedure PurchDB.ReportMonitor (NEW.ReportName,
     NEW.ReportOwner, 'UPDATE');

     CREATE RULE PURCHDB.DELETEREPORT
     AFTER UPDATE
      ON PURCHDB.REPORTS
     execute procedure PurchDB.ReportMonitor (OLD.ReportName,
     OLD.ReportOwner, 'DELETE');

     COMMIT WORK;



MPE/iX 5.5 Documentation