RDOHELP72.HLB  —  INVOKE
    Specifies the name of the database to be accessed in a program
    or by RDO. You must issue an INVOKE DATABASE statement before you
    can use any other statement to reference data in that database.
    Using INVOKE is equivalent to declaring an external subroutine;
    it declares the database to the program.

    Example:

    RDO>  INVOKE DATABASE FILENAME 'DISK2:[DEPT4]PERSONNEL'

1  –  Format

  (B)0INVOKE DATABASE qwqqqqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqqqqqqqqqwqqk
                   tqqqqqqqqqqqq>qqqqqqqqqqqqqqwq> db-handle q> = j  x
                   mq> db-handle-scope-optionsqj                     x
       lqqqqqqqqqqqqqqqqqqqqqqqqq<qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
       mqqwqqqqqqqqq>qqqqqqqqqwqqwqq> PATHNAME qqq> path-name qqwqk
          mqq> COMPILETIME qqqj  mqq> FILENAME qqq> file-spec qqj x
       lqqqqqqqqqqqqqqqqqqqqqqqqqq<qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
       mqqwqqqqqqqqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqqk
          mqq> RUNTIME FILENAME qqqqwqqqq> file-spec qqqqqqqqwqqqj   x
                                    mqqqq> host-variable qqqqj       x
       lqqqqqqqqqqqqqqqqqqqqqqqqqq<qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
       mqqwqqqqqqqqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqqqqqqqqwqqk
          mqq> DBKEY SCOPE IS qqqwqqq> COMMIT qqqqqqwqqqqqqqj  x
                                 mqqq> FINISH qqqqqqj          x
       lqqqqqqqqqqqqqqqqqqqqqqqqqq<qqqqqqqqqqqqqqqqqqqqqqqqqqqqj
       mqqwqqqqqqqqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqqqqwqqqqqqk
          mqq> REQUEST_HANDLE SCOPE IS qwq> DEFAULT qqwqj      x
                                        mq> FINISH qqqj        x
       lqqqqqqqqqqqqqqqqqqqqqqqqqq<qqqqqqqqqqqqqqqqqqqqqqqqqqqqj
       mqqwqqqqqqqqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqqqqqqqqqqqwqqq>
          mqq> PRESTARTED TRANSACTIONS ARE qqwqq> ON  qqqqqqqqqu
                                             mqq> OFF qqqqqqqqqj

1.1  –  db-handle

    A host language variable that you associate with the name of the
    database. Use database handles when you are accessing more than
    one database at a time. Do not declare a host language variable
    explicitly for the database handle. The Oracle Rdb preprocessors
    declare the variable for you.

    You can make a handle local to the module in which it is declared
    (LOCAL), or global to all modules that declare the database
    (GLOBAL, EXTERNAL).

    The default is GLOBAL.

1.2  –  path-name

    A full or relative data dictionary path name specifying the
    source of the database definitions.

1.3  –  file-spec

    A full or partial OpenVMS file specification specifying the
    source of the database definitions.

1.4  –  host-variable

    A valid host language variable that equates to a database file
    specification.

1.5  –  COMPILETIME

    The source of the database definitions when the program is
    compiled. This can be either a data dictionary path name or an
    OpenVMS file specification. If you specify only the COMPILETIME
    identifier and omit the RUNTIME identifier, Oracle Rdb uses the
    COMPILETIME identifier for both compiling and running the
    program.

1.6  –  RUNTIME

    The source of the database definitions when the program is
    run. This can be either an OpenVMS file specification or a host
    language variable. If you do not specify this parameter, Oracle Rdb
    uses the COMPILETIME identifier for both compiling and running
    the program.

1.7  –  DBKEY_SCOPE_COMMIT

    The DBKEY SCOPE clause controls when the database key (dbkey) of
    an erased record may be reused by Oracle Rdb. When the DBKEY SCOPE
    is COMMIT, Oracle Rdb cannot reuse the dbkey of an erased record
    to store another record until the transaction that erased the
    original record completes (by entering COMMIT).

    The DBKEY SCOPE COMMIT clause specifies that the dbkey of each
    record used is guaranteed to remain consistent only during each
    transaction.

1.8  –  DBKEY_SCOPE_FINISH

    With the DBKEY SCOPE IS FINISH clause, Oracle Rdb cannot reuse the
    dbkey (to store another record) until the user who erased the
    original record detaches from the database (by using the FINISH
    statement).

    Further, the DBKEY SCOPE FINISH clause specifies that the dbkey
    of each record used is guaranteed not to change until this user
    detaches from the database(usually, with FINISH).

1.9  –  REQUEST_HANDLE_SCOPE_DEFAULT

    The REQUEST_HANDLE SCOPE clause is only used by RDBPRE and RDML
    programs, not with RDO or RDB$INTERPRET. In a RDBPRE program
    where an RDO request occurs within a higher level language loop,
    the REQUEST_HANDLE SCOPE clause determines whether system or
    user request handles are set to zero in the RDO FINISH statement
    within the loop.

    The default is DEFAULT, where the values of the request handles
    are not set to zero when the RDO FINISH statement executes.

1.10  –  REQUEST_HANDLE_SCOPE_FINISH

    The REQUEST_HANDLE SCOPE clause is only used by RDBPRE and RDML
    programs, not with RDO or RDB$INTERPRET. In a program where an
    RDO request occurs within a higher level language loop, the
    REQUEST_HANDLE SCOPE clause determines whether system or user
    request handles are set to zero in the RDO FINISH statement
    within the loop.

    With the REQUEST_HANDLE SCOPE is FINISH clause, the values of the
    request handles are set to zero after the RDO statement FINISH
    executes.

1.11  –  PRESTARTED_TRANSACTIONS_ARE_ON

    Explicitly enables prestarted transactions.

    For most applications, Rdb recommends that you enable prestarted
    transactions. The default is PRESTARTED TRANSACTIONS ARE ON.
    If you use the PRESTARTED TRANSACTIONS ARE ON clause or do not
    specify the PRESTARTED TRANSACTIONS clause, the COMMIT or
    ROLLBACK statement for the previous read/write transaction
    automatically reserves the TSN for the next transaction and
    reduces I/O.

1.12  –  PRESTARTED_TRANSACTIONS_ARE_OFF

    Disables prestarted transactions.

    Use the PRESTARTED TRANSACTIONS ARE OFF clause only if your
    application uses a server process that is attached to the
    database for long periods of time and causes the snapshot file
    to grow excessively. If you use the PRESTARTED TRANSACTIONS
    ARE OFF clause, Oracle Rdb uses additional I/0 because each START
    TRANSACTION statement must reserve a transaction sequence number
    (TSN).

2  –  More

    You must have the Oracle Rdb READ privilege for a database to invoke
    it using the INVOKE DATABASE statement.

3  –  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