DELETE |
![]() ![]() ![]() |
The DELETE command deletes specified records from a file.
Format
DELETE {DICT} file.name {record.name ...}
DELETE {DICT} file.name {NO.QUERY} To use a select list
DELETE {DICT} file.name ALL {NO.QUERY}
where
If no record names are specified and the default select list is active, this list is used to determine the names of the records to be deleted. A confirmation prompt is issued before deletion commences unless the NO.QUERY option is used.
The DELETE command reports the number of records deleted on completion.
@SYSTEM.RETURN.CODE is returned as the number of records deleted unless the delete fails in which case it contains the error code.
Examples
SELECT STOCK WITH PART.NO < 10000 DELETE STOCK 71 records deleted
This example selects all records from the STOCK file with PART.NO less than 10000 and deletes them.
DELETE PARTS.FILE A12745 A84543 C36590 Record A84543 not found 2 records deleted
This example attempts to delete three specific records from PARTS.FILE. One of the records does not exist. |