4 Database Manipulation
The DBDELETE Statement
DBDELETE deletes existing data entries in a manual-master or detail data set.
DBDELETE (base name, data set, mode, status)
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 DBDELETE is executed. The array must contain at least ten elements in its right-most dimension.
When deleting entries from master data sets, all pointer information for chains indexed by the entry must indicate that the chains are empty. In other words, there must not be any detail entries on the paths defined by the master which have the same search item values as the master entry to be deleted.
When deleting detail set entries, Eloquence DBMS performs the required changes to chain linkages and other chain information, including the chain heads in related master data sets. If the last member of each detail chain linked to the same automatic master has been deleted, Eloquence DBMS also deletes the master entry containing the chain heads.
DBDELETE Status Array
A DBDELETE 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 . The following table describes the status array contents after a successful DBDELETE.
Array Element | Value | Description |
1 | 0 | CW. |
2 | Record length | Data set record length in words. |
3 | 0 | |
4 | Record Number | Address of deleted record. |
5 | 0 | |
6 | 0 | |
7 | 0 | |
8 | Backward Address | The unchanged backward address of a chain. |
9 | 0 | |
10 | Forward Address | The unchanged forward address of a chain. |
Eloquence Database Manual - 19 DEC 2002