Epi Info™ User Guide

Command Reference


Analysis Commands: DELETE RECORDS

Description
This command deletes selected records.

Syntax
DELETE * {PERMANENT | RUNSILENT}
DELETE expression {PERMANENT | RUNSILENT}

Comments
All records in the current selection are set to deleted status. This means each record’s RECSTATUS value is changed from 1 to 0.   These records can be undeleted.  If the PERMANENT keyword is specified, the records are physically deleted from the database and cannot be undeleted.   A confirmation message indicates the number of records affected unless the RUNSILENT keyword is selected.

Examples
Example 1: The code below will permanently erase all records in the current data source where the AgeInDays variable contains a value greater than five. Permanent deletions cannot be undone.

DELETE ( AgeInDays > 5 ) PERMANENT

Example 2: The code below will mark all records in an Epi Info 7 database for deletion.  Since these records are logically marked for deletion, rather than permanently deleted, the UNDELETE Command can restore these records.

DELETE *
Page last reviewed: September 16, 2022, 12:00 pm