xHarbour Reference Documentation > Command Reference |
Removes records marked for deletion physically from a database file.
PACK
The PACK command removes all records marked for deletion physically from the database file open in the current work area. Disk space occupied by deleted records is recovered and all open indexes are REINDEXed. When the PACK command is complete, the record pointer is positioned on the first logical record.
The database nust be open in EXCLUSIVE mode to run the PACK command. Otherwise, a runtime error is generated.
See also: | DELETE, Deleted(), RECALL, REINDEX, SET DELETED, USE, ZAP |
Category: | Database commands |
Source: | rdd\dbcmd.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example removes inactive customers from a database: PROCEDURE Main USE Customer INDEX Cust01, Cust02 EXCLUSIVE ? LastRec() // result: 200 DELETE FOR Year(CONTCTDATE)-Year(Date()) > 5 PACK ? LastRec() // result: 194 CLOSE Customer RETURN
http://www.xHarbour.com