| 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.4 Creating an Object
Creates an object of the FJDB-DATABASE class using a CREATE-OBJECT method.
INVOKE FJDB-DATABASE "CREATE-OBJECT" USING DSN UID PWD SCM OPT ERROR-A
RETURNING DATABASE-A.
DSN [attribute:X(nn) nn is an area length]
Specifies a database environment name.
UID [attribute:X(nn) nn is an area length]
Specifies the user ID.
PWD [attribute:X(nn) nn is an area length]
Specifies the password.
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 EXECUTE-SQL method, or the CREATE-COMMAND 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 EXECUTE-SQL method, or the CREATE-COMMAND method.
OPT [attribute:S9(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 used to specify multiple options.
(Specifying multiple options)
COMPUTE OPT = FJDB-SCDBOPT-READONLY + FJDB-SCDBOPT-READCOMMITED
INVOKE FJDB-DATABASE "CREATE-OBJECT" USING DSN ` OPT ERROR-A
RETURNING DATABASE-A.
Available options are listed below.
(1) Database updatability attribute mode
iFJDB-SCDBOPT-READONLY)
Determine 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)
Determine whether to set the isolation level as READ COMMITED or READ UNCOMMITED. 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. |
ERROR-A [attribute:OBJECT REFERENCE FJDB-ERROR]
Returns an object of the FJDB-ERROR class if the method fails to end normally.
DATABASE-A [attribute:OBJECT REFERENCE FJDB-DATABASE]
Returns an object of the FJDB- DATABASE class if the method ends normally; otherwise, returns a NULL object.
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 in it 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
![]()
|