4 Database Manipulation

The DBCLOSE Statement

DBCLOSE terminates access to the specified database.

DBCLOSE (base name, data set, mode, status)

The parameters are:

base name
The same string variable used when opening the database.
data set
Any string or numeric expression.
mode
A numeric expression equal to 1 or 3.
status
An integer array variable that returns status information after DBCLOSE is executed. The array must contain at least ten elements in its right-most dimension.

DBCLOSE Modes

Two modes are available when closing a database.

Mode 1: Close the database. The database described is closed, the memory segment assigned by DBOPEN is released, and the first two bytes of the base name parameter are reset to blanks. The data set parameter is ignored.

Mode 3: Data set rewind. The specified data set pointer is reset to the first item in the set.

DBCLOSE Status Array

A DBCLOSE error assigns a non-zero condition word (CW) to the first element of the status array. A list of all CW values and their meanings appears in page 197 . The following table describes the status array contents after a successful DBCLOSE.

 
Array Element Value Description
10CW.
2 through 4Unchanged 
50 
6403The DBCLOSE identification number.
7Program line number 
80 
9Mode numberThe mode parameter value.
10Any valueReserved.

The execution of certain system commands causes an implicit DBCLOSE to be performed. For example, the RUN and SCRATCH C commands perform a mode 1 DBCLOSE on all databases currently opened by the user. This terminates access to the database until a DBOPEN is executed. The following list of statements and keys perform an implicit DBCLOSE in mode 1.

STOP or END

RUN

SCRATCH C

SCRATCH A

CTRL Y *

QUIT

QQUIT

* CTRL Y performs an implicit DBCLOSE only in the run-time version of Eloquence (not the development version).


Eloquence Database Manual - 19 DEC 2002