HP 3000 Manuals

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


ALLBASE/SQL Database Administration Guide

GENERATE TABLES 

Generates SQL commands to recreate one or more tables of a DBEnvironment.

Scope 

SQLGEN Only

SQLGEN Syntax 

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

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

{N[O] }  Do you wish to generate associated Table Authority (n/y)?
{Y[ES]}

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

each Owner (n/y)?  {N[O] }  Table Name >> TableName 
                   {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 indexes; respond YES if you want to
                        generate associated indexes.

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 tables you wish to
                        generate.

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

TableName               is the name of a table you wish to generate.

Description 

   *   GENERATE TABLE builds CREATE TABLE commands to recreate one or
       more tables of the DBEnvironment.  You can also recreate
       associated indexes and authorities for the specified tables.

   *   If a referential constraint exists, the referential constraint
       clause is omitted from the CREATE TABLE command and included in a
       subsequent ALTER TABLE command.

Example 

     >> generate tables 

     ALLBASE/SQL Command Generator for Tables

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

     Do you wish to generate associated Indexes (n/y)? y 
     Do you wish to generate associated Table 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 Table Names for each Owner (n/y)? y 

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

     Table Name for Owner PURCHDB >> inventory 

     Generating CREATE TABLE PURCHBD.INVENTORY

     Generating CREATE INDEX on PURCHDB.INVENTORY

     Generating Authority for PURCHDB.INVENTORY

     Table Name for Owner PURCHDB >>   Return  

     Owner Name >>   Return  

     >>

Schema File Produced 

       CREATE PUBLIC TABLE PURCHDB.INVENTORY
       (PARTNUMBER             CHAR(  16)     NOT NULL,
        BINNUMBER              SMALLINT       NOT NULL,
        QTYONHAND              SMALLINT,
        LASTCOUNTDATE          CHAR(   8),
        COUNTCYCLE             SMALLINT,
        ADJUSTMENTQTY          SMALLINT,
        REORDERQTY             SMALLINT,
        REORDERPOINT           SMALLINT) IN WAREHFS;

     CREATE UNIQUE INDEX INVPARTNUMINDEX
        ON PURCHDB.INVENTORY
        (PARTNUMBER);

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

     GRANT SELECT,
           INSERT,
           DELETE,
           UPDATE
       ON PURCHDB.INVENTORY TO PURCHASING;

     GRANT ALL
       ON PURCHDB.INVENTORY TO PURCHDBMAINT;

     GRANT SELECT
       ON PURCHDB.INVENTORY TO PURCHMANAGERS;

     GRANT SELECT,
           INSERT,
           DELETE,
           UPDATE
       ON PURCHDB.INVENTORY TO WAREHOUSE;

     REVOKE ALL
       ON PURCHDB.INVENTORY FROM PUBLIC;

     COMMIT WORK;



MPE/iX 5.5 Documentation