DELETE

DELETE

Top  Previous  Next

 

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

 

DICTindicates that the records are to be deleted from the dictionary portion of the named file.

 

file.nameis the name of the file holding the records to be deleted.

 

record.nameis the name of the record to be deleted. Multiple record names may be specified in a single DELETE command.

 

ALLcauses all records to be deleted.

 

NO.QUERYsuppresses the confirmation prompt when using a select list. The NO.SEL.LIST.QUERY mode of the OPTION command can be used to imply this option.

 

 

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.

 

If a record to be deleted is locked by another user, a warning message is displayed and the DELETE command continues without deleting the record.

 

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.