HP 3000 Manuals

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


ALLBASE/SQL Database Administration Guide

GENERATE VIEWS 

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

Scope 

SQLGEN Only

SQLGEN Syntax 

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

SchemaFileName  Do you wish to generate associated View Authority (n/y)?

{N[O] }  Owner Name >> OwnerName  Do you wish to specify View Names for
{Y[ES]}

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

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

NO or YES               respond NO if you do not want to generate
                        associated authorities; respond YES if you want
                        to generate associated authorities.

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

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

ViewName                is the name of a view you wish to generate.

Description 

   *   GENERATE VIEWS builds CREATE VIEW commands to recreate one or more
       views in the DBEnvironment.  You can also recreate associated
       authorities for the specified views.

Example 

     >> generate views 

     ALLBASE/SQL Command Generator for Views

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

     Do you wish to generate associated View Authority (n/y)? y 

     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 View Names for each Owner (n/y)? y 

     Enter View Names for Owner PURCHDB
     Type @ for all, ? for a list of View Names, or RETURN to quit.

     View Name for Owner PURCHDB >> vendorstatistics 

     Generating CREATE VIEW PURCHDB.VENDORSTATISTICS

     Generating Authority for PURCHDB.VENDORSTATISTICS

     View Name for Owner PURCHDB >>   Return  

     Owner Name >>   Return  

     >>

Schema File Produced 

     SET OWNER PURCHDB;
     CREATE VIEW PURCHDB.VENDORSTATISTICS
          (VENDORNUMBER,
           VENDORNAME,
           ORDERDATE,
           ORDERQUANTITY,
           TOTALPRICE)  AS
     SELECT PurchDB.Vendors.VendorNumber,PurchDB.Vendors.VendorName
     , OrderDate, OrderQty, OrderQty*PurchasePrice FROM
     PurchDB.Vendors, PurchDB.Orders, PurchDB.OrderItems WHERE
     PurchDB.Vendors.VendorNumber = PurchDB.Orders.VendorNumber AND
     PurchDB.Orders.OrderNumber = PurchDB.OrderItems.OrderNumber;

     GRANT SELECT
        ON PURCHDB.VENDORSTATISTICS TO PURCHMANAGERS;

     GRANT SELECT
        ON PURCHDB.VENDORSTATISTICS TO PURCHDBMAINT;

     GRANT SELECT
        ON PURCHDB.VENDORSTATISTICS TO TOM@ASH;

     GRANT SELECT,
           INSERT,
           DELETE,
           UPDATE
        ON PURCHDB.VENDORSTATISTICS TO DBEUSERS;



MPE/iX 5.5 Documentation