Library /sys$common/syshlp/RDOHELP72.HLB  —  INVOKE  Examples
    Example 1

    The following example invokes a database in RDO:

    RDO> INVOKE DATABASE PATHNAME 'DISK1:[DICTIONARY]CORP.MIS.PERSONNEL'

    This example uses the data dictionary definitions in
    DISK1:[DICTIONARY]CORP.MIS.PERSONNEL to invoke the PERSONNEL
    database in RDO.

    Example 2

    The INVOKE DATABASE statement must be part of every program:

    &RDB& INVOKE DATABASE FILENAME 'DISK2:[DEPT3]PERSONNEL'

    This statement declares the database defined by the file
    specification DISK2:[DEPT3]PERSONNEL. The preprocessor then uses
    this definition when compiling the program, and Oracle Rdb uses the
    database file DISK2:[DEPT3]PERSONNEL.RDB when the program runs.

    Example 3

    The following BASIC example invokes a database using an EXTERNAL
    database handle:

     &RDB& INVOKE DATABASE EXTERNAL
     &RDB&   PERSONNEL = PATHNAME 'DISK1:[DICTIONARY]CORP.MIS.PERSONNEL'

    This example shows a global declaration. Other modules in the
    program can refer to the database using the handle PERSONNEL;
    they must use the same database handle for the same database. The
    program does not declare the variable.

    o  GLOBAL and EXTERNAL are synonymous. These make the database
       handle global to all modules that declare the database.
       Oracle Rdb creates a PSECT containing one longword using the
       name supplied by the user with the overlay attribute.

    o  The default database scope is GLOBAL.

    o  The preprocessor generates declarations for all database
       handles.

    Example 4

    The following COBOL example uses the COMPILETIME and RUNTIME
    options:

       &RDB& INVOKE DATABASE LOCAL PERSONNEL =
       &RDB&    COMPILETIME PATHNAME
       &RDB&      'DISK1:[DICTIONARY]ACCT.PERSONNEL'
       &RDB&    RUNTIME FILENAME
       &RDB&      'USERDISK3:[DEPT3]PERSONNEL'

    This example declares the database using two different sources:

    o  At compile time, the preprocessor uses the database
       definitions in the data dictionary.

    o  At run time, Oracle Rdb uses the definition in file
       USERDISK3:[DEPT3]PERSONNEL.RDB.
Close Help