The idelrec function is called to delete a record from a database. It requires two arguments, the database handle and the index handle. The record corresponding to the current record for the specified index is deleted from the database. Entries for the deleted record are automatically removed from all indexes.
The following example program deletes a record from the BOOKS database. The record to be deleted is identified by its ISBN number. First, the ifindkey function is called to find the record corresponding to a specified ISBN number. If the record is found, it becomes the current record for the ISBN index, then the idelrec function is called to delete the record. If the record is not found, then no record is deleted.