SET ACCESS MODULE

The SET ACCESS MODULE statement overrides the default access module to be used by a transaction. You can issue only one SET ACCESS MODULE statement in any given transaction. It is also a CA IDMS extension of the SQL standard. You can use this statement only in SQL that is embedded in a program.
idmscu
The SET ACCESS MODULE statement overrides the default access module to be used by a transaction. You can issue only one SET ACCESS MODULE statement in any given transaction. It is also a CA IDMS extension of the SQL standard. You can use this statement only in SQL that is embedded in a program.
Authorization
None required.
Syntax
  ►►─── SET ACCESS MODULE ─┬─ 
access-module-name
 ───────────┬───────────────────►◄                          └─ :
access-module-variable-name
 ─┘  
Parameters
  • access-module-name
    Specifies the access module to be used by the current transaction.
    Access-module-name
    must identify an access module stored in the dictionary.
  • :
    access-module-variable-name
    Identifies a host variable, local variable, or routine parameter containing the name of the access module to be used by the current transaction.
    Access-module-variable-name
    must be a variable previously defined in the application program or SQL routine.
    If
    access-module-variable-name
    is a local variable or routine parameter, the colon must not be coded.
Usage
Order of Execution
If used, the SET ACCESS MODULE statement must be executed before any statement in the transaction
other than
:
  • CONNECT
  • SET SESSION
  • SET TRANSACTION
Default Access Module
By default, a transaction uses the access module associated with the application program issuing the first SQL statement executed within the SQL session.
One Access Module for a Transaction
A transaction can use only one access module.
Example
Setting the Access Module
The following SET ACCESS MODULE specifies that the current transaction is to use the access module identified by the host variable TRANS-ACC-MOD:
EXEC SQL    SET ACCESS MODULE :TRANS-ACC-MOD END-EXEC
For more information about setting the access module for a transaction, see Preparing and Executing the Program .