4 Modifying the Database

Deleting Entries

If you would like to delete one or more data items, you must first use the FIND command to copy the data item(s) into the workfile. Then you can execute Query's DELETE command to delete the item(s):

DELETE item list

The item list is a list of data items to be deleted. All data items must be in the same data set. When a data item is deleted, its value is changed to null character(s). If all the data items in a data set are specified in the item list, the entire data entry is deleted; the values of the data items are not simply changed to nulls.

For example, assume the ORDER_NO 25 was cancelled. The following shows how the entry is deleted from the database:

   FIND CUSTOMER FOR CUSTOMER.ORDER_NO="25"
   **  1 entry found
   DELETE CUSTOMER

   FIND OPTION FOR OPTION.ORDER_NO="25"
   **  1 entry found
   DELETE OPTION

NOTE: If one of the entries in a list cannot be deleted, Query issues an error message; it then goes to the next entry and continues deleting.

Deleting Key Items

It is not possible to delete just the key item in a detail data set; the entire data entry must be deleted.

The entries in a manual master data set are deleted in the same manner as deleting an entry from a detail data set. To delete a key item from a manual master data set you must first delete all entries in associated detail data sets that have the same key item value as that of the manual master you wish to delete.

Entries are deleted from an automatic master data set for you.


Eloquence Query Manual - 19 DEC 2002