4 Database Manipulation
The DBUPDATE Statement
DBUPDATE modifies item values in a data entry.
DBUPDATE (base name, data set, mode, status, list, buffer)
The parameters are:
- base name
- The same string variable used when opening the database.
- data set
- Either a string expression containing a left-justified data set name or a numeric expression containing a data set number corresponding to the data set's position in the schema definition.
- mode
- A numeric expression equal to 1.
- status
- An integer array variable that returns status information after DBUPDATE is executed. The array must contain at least ten elements in its right-most dimension.
- list
- A string variable containing @$\triangle$ or @; or @ ($\triangle$ represents a space). This value means that only entire records can be accessed and is referred to as the full record mode.
- buffer
- A simple string variable containing data that is to replace the current data entry in the specified set.
Since search items cannot be updated, the search item value must match the present buffer value for that item. Before updating a data entry, DBUPDATE must be preceded by a DBGET or DBPUT to establish the current record pointer.
The data item values of the current data entry are replaced using the data supplied. Since data is only transferred in the full record mode, the buffer must contain all the values for the items contained in the data set entry. The search item values in the buffer must match the old values of the current record or the update is not performed.
DBUPDATE Status Array
A DBUPDATE error assigns a non-zero conditional word (CW) to the first element of the status array. A list of all CW values and their meanings appears in page 197 . For a successful DBUPDATE, the status array contents are as described under DBGET, except that the second element represents the number of words transferred from the buffer to the data set.
Eloquence Database Manual - 19 DEC 2002