| DB Access Class Library for COBOL V1.0 API Reference - Microsoft(R) Windows(R) - - Microsoft(R) Windows NT(R) - - Microsoft(R) Windows(R) 2000 - |
Contents
Index
![]()
|
Chapter 6 DB Access Library API Reference
6.2 Methods
Opens the database and returns an object of the FJDB-DATABASE class.
INVOKE SESSION-A "OPEN-DATABASE" USING DSN UID PWD SCM OPT DATABASE-A
RETURNING RET-CODE.
SESSION-A [attribute:OBJECT REFERENCE FJDB-SESSION]
Specifies an object of the FJDB-SESSION class.
DSN [attribute:X(nn) nn is an area length]
Specifies the database environment name defined in the DB access class library environment setting.
UID [attribute:X(nn) nn is an area length]
Specifies the user ID to connect to the database.
PWD [attribute:X(nn) nn is an area length]
Specifies the password associated with the user ID used to connect to the database.
SCM [attribute:X(nn) nn is an area length]
Specifies the default schema name for the SQL statement that is specified in the OPEN-RECORDSET method, the CREATE-COMMAND method, or the EXECUTE-SQL method aimed at an object of the FJDB-DATABASE class.
The default schema name complements a table when it is not qualified by a schema name in the SQL statement that is specified in the OPEN-RECORDSET method, the CREATE-COMMAND method, and the EXECUTE-SQL method.
OPT [attribute:FS9(9) COMP-5]
Specifies a database run-time option with a symbolic constant or integer. A mix of multiple symbolic constants, or associated values, can be specified to specify multiple options.
(Specifying multiple options)
COMPUTE OPT = FJDB-SCDBOPT-READONLY + FJDB-SCDBOPT-READCOMMITED
INVOKE SESSION-A "OPEN-DATABASE" USING DSN ` OPT DATABASE-A
RETURNING RET-CODE.
Available options are listed below.
(1) Database updatability attribute mode
(FJDB-SCDBOPT-READONLY)
Decide whether to make the open database both readable and writable or read-only.
The default is both readable and writable.
(2) Isolation level mode
(FJDB-SCDBOPT-READCOMMITED)
Decide whether to set the isolation level as READ COMMITED or READ UNCOMITED.
The default is READ UNCOMMITED.
The isolation level is a transaction mode in which reference and update to data are controlled to enable multiple transactions to gain access to the same resource without causing data inconsistencies.
| Symbolic constant | Value | Meaning |
| FJDB-SCDBOPT-DEFAULT | 0 | Do not use any option. |
| FJDB-SCDBOPT-READONLY | 1 | Open the database with a read-only attribute. |
| FJDB-SCDBOPT-READCOMMITED | 2 | Set the isolation level as READ COMMITED. |
DATABASE-A [attribute:OBJECT REFERENCE FJDB-DATABASE]
Specifies the object variable in which an object of the FJDB-DATABASE class is stored.
RET-CODE [attribute:S9(9) COMP-5]
Returns a value of 0 if the method ends normally; otherwise, returns an error code.
With a non-SymfoWARE database, set the same value as the user ID (UID) in the default schema (SCM).
A library file having symbolic constants defined within FJDBOPT.CBL is stored in the COPY folder of the folder in which the DB access class library is installed. To use symbolic constants in a program, see the following instructions:
Example:
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.
SYMBOLIC CONSTANT
COPY FJDBOPT.
.
Contents
Index
![]()
|