Module 10: File processing
DELETE statement
- Used to logical remove records from indexed and relative files only
- It deletes the most recently read record
- To delete a record, the file should be opened in I-O mode
- Basic syntax:-
DELETE file-name RECORD [INVALID KEY imperative-statement-1] [NOT INVALID KEY imperative-statement-2] [END-DELETE].
- Where,
- file-name is logical file name from which record is to be deleted
- INVALID KEY imperative-statement-1 : This becomes true when record is not found causes execution of imperative-statement-1
- NOT INVALID KEY imperative-statement-2: This is used to specify statements to be executed when DELETE operation succeeds