The DBOPEN statement uses a database specification, which consists of three terms:
[[server][:service]/][Database]
For example:
- server
- The name or IP number of the system running the database server. If it is omitted, the local system is assumed.
- service
- The service name or port number of the data base server. If it is omitted, the default service name "eloqdb" is assumed.
- database
- The database name. For HP Eloquence A.05.xx databases, this is the absolute path. For HP Eloquence A.06.xx, this is simply the data base name. Please note, that the data base name is not case sensitive.
Db$=" sampledb" DBOPEN(Db$,"",1,S(*))This opens the database sampledb on the local system, using the default service.
Db$=" server/sampledb"This would connect the default data base server running on the system named "server".
Db$=" server:eloqdb5/path/to/sampledb"This would connect the default data base server, running on the system named "server" using the port associated with the service name "eloqdb5". For HP Eloquence A.05.xx compatible databases, it is required to specify an absolute path.
All the connection details could be hidden in a VOLUME definition. If a volume DBVOL is defined as below (for example in your .eloqrc file)
DBVOL="server:eloqdb5/path/to"then the code below
Db$=" sampledb,DBVOL"would connect to data base server:eloqdb5/path/to/sampledb.
The DBLOGON statement is used to provide authorization data which are transmitted to the data base server, when a data base is openend. The HP Eloquence A.06.00 data base no longer uses data base passwords. For HP Eloquence A.05.xx data bases, the logon information is ignored.
Syntax:
DBLOGON(User$,Pswd$)Description:
When no DBLOGON statement is executed before opening a data base, the data base server will try to access the data base as user "public" and an empty password.
- User$
- A string variable containing the user name, for example "fred".
- Pswd$
- A string variable containing the password for the given user, for example "secret".
For example:
User$="fred" Pswd$="secret" DBLOGON(User$,Pswd$) ... DBOPEN(Db$,"",1,S(*))
Pending data base changes are neither visible to other users nor can they be changed concurrently. All pending data base records are locked automatically by the data base server and any attempt to modify them will cause the concurrent task to become paused.
Transactions can be nested. The DBCOMMIT or DBROLLBACK statements usually operate on the last (sub-) transaction. Data base modifications are not stored permanently in the data base, until a top level DBCOMMIT is executed. The DBROLLBACK statement can be used to undo all pending modifications until a specific checkpoint.
Please note, that the transaction handling statements do not operate on a particular data base. Instead they operate on all data bases at once. A pending commit or rollback is even performed after closing the data base. In case a data base server connection is lost (for example, because the server has been killed), all pending modifications on all data bases are automatically reverted.
Syntax:
Syntax:
Syntax:
The DBBEGIN statement
The DBBEGIN statement begins a new (sub-) transaction.
When this is the first transaction, it is called top level transaction.
No modifications are permanently saved in the HP Eloquence A.06.00 data base
until the top level transaction is committed.
A subsequent DBBEGIN begins a new subtransaction, which can
be controlled separately with the DBCOMMIT and DBROLLBACK
statements.
DBBEGIN(Comment$,Mode,Status(*))
Description:
Up to 20 transactions can be nested. Each DBBEGIN statement
returns a unique (process specific) transaction id, which can be used
with the DBROLLBACK statement to revert all modifications
until this state.
Mode Description 1 Begin transaction
Element Description 1 Completion code 2 Transaction ID 3 Transaction nesting level The DBCOMMIT statement
The DBCOMMIT statement commits a transaction. If this is a top level
transaction, modifications are made permanently in the data base.
If a subtransaction is committed, it becomes part of its parent
transaction.
DBCOMMIT(Mode,Status(*))
Description:
Mode Description 1 Commit current (sub-)transaction 2 Commit top level transaction
Element Description 1 Completion code The DBROLLBACK statement
The DBROLLBACK statement is used to undo a pending transaction.
If this is a top level transaction, all pending modifications are reverted.
If applied to a subtransaction all modifications including the enclosing
DBBEGIN statement are reverted.
DBROLLBACK(Id,Mode,Status(*))
Description:
In Mode 2, a transaction id must be specified which was obtained
from DBBEGIN. This can be used to revert up to a specific
checkpoint.
Mode Description 1 Rollback current (sub-)transaction 2 Rollback given transaction 3 Rollback top level transaction
Element Description 1 Completion code 3 Transaction nesting level The DBEXPLAIN$ function
The DBEXPLAIN$ function translates the given status into a descriptive
message.
X$=DBEXPLAIN$(Status(*))
X$=DBEXPLAIN$(n)
New status codes
The following data base status codes are new to A.06.00:
Status | Description |
---|---|
-3 | User name not recognized |
-4 | User password does not match |
32 | Transaction nesting exceeds maximum |
33 | No transaction active |
-801 | Volume operation failed |
-802 | Node related failure |
-803 | FIXREC related problem |
-804 | BTREE related problem |
-805 | System catalog operation failed |
-806 | System operation failed |
Status codes -801 to -806 usually indicate internal problems. In this case, the status element 10 provides more detailed information.
With the HP Eloquence A.06.00 database, the following status codes can no longer happen:
-94 | Database may be corrupt |
-96 | Corrupt pointer value detected |
94 | Corrupt data base openend in mode 8 |
The following statements are no longer supported with HP Eloquence A.06.00.