xHarbour Reference Documentation > Function Reference |
Marks records for deletion.
DbDelete() --> NIL
The return value is always NIL.
This function marks a record for deletion in the current or aliased work area. If SET DELETED is ON, the record will continue to be visible until the record pointer in the work area is moved.
Note that DbDelete() sets a flag on the current record which marks it only as deleted. Call PACK to physically remove records marked as deleted from the database.
Once set, the Deleted flag can be removed again using the DbRecall() function.
In a networking situation, this function requires the current record be locked prior to calling the DbDelete() function.
See also: | DbRecall(), DELETE, Deleted(), NetDelete(), PACK, RECALL |
Category: | Database functions |
Source: | rdd\dbcmd.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example shows a typical coding pattern used for setting the // deletion flag in a networking situation. PROCEDURE Main LOCAL cCustID := "10" USE Customer ALIAS Cust INDEX CustId NEW IF Cust->(DbSeek( cCustId )) IF Cust->(RLock()) Cust->(DbDelete()) Cust->(DbCommit()) Cust->(DbUnLock()) ENDIF ENDIF USE RETURN
http://www.xHarbour.com