xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

DbDelete()

Marks records for deletion.

Syntax

DbDelete() --> NIL

Return

The return value is always NIL.

Description

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.

Info

See also:DbRecall(), DELETE, Deleted(), NetDelete(), PACK, RECALL
Category: Database functions
Source:rdd\dbcmd.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// 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

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe