602SQL Documentation Index  

Restoring Deleted Records

602SQL deletes table records in two steps (unless the opposite setting is chosen for the compatibility attribute SQLOPT_EXPLIC_FREE). The record is marked as deleted in the first step, but the contents are preserved. Therefore, it can still be restored. The record contents are deleted in the second step (record drop) and the free space can be used to insert another record.

The general table state (number of valid, deleted and dropped records) can be displayed using the Record statistics command from the pop-up menu of the table.

Displaying Table Including Deleted Records

You can display the table in a grid using the 602SQL Client that allows you to display deleted records and free space left after the dropped records. One more column called Deleted? appears in the grid. The deleted column may have one of these three values:
not checked (FALSE) valid record
checked (TRUE) deleted record, can be restored
gray (NULL) dropped record, cannot be restored.

You can open a table in this way by holding the Ctrl key when executing the Open command.

NOTE: There may be some records at the end of the table that are marked as dropped, even though nobody deleted or dropped them. This is connected with the method of inserting records into a table and has no effect on the table.

NOTE: If user server warnings (TRACE_USER_WARNING) are traced, each deleted record will evoke a new entry to the log (thus slowing response).

Record Restoration

You can restore a deleted record by unchecking the Deleted? checkbox on the desired record. You can delete records in this way as well. You must have the privileges to delete (drop) records on this table.

You can restore deleted application objects in this way as well (records in the object system table). You may not restore deleted tables.