DBF DELETE()

From Recital Documentation Wiki
Revision as of 10:44, 30 March 2009 by Yvonnemilne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

PURPOSE

Return the database name


SYNONYM

api_dbf_delete()


SYNOPSIS

#include "dbapi.h"
 
int	DBF_DELETE()
 
<input parameters>
none
 
<output parameters>
none


DESCRIPTION

The DBF_DELETE() function will delete the current record in the active database. On shared databases the record should be locked first before it is deleted. If you attempt to delete a record that is locked by another user, then Recital will display an error message.

Deleted records remain in the database until a PACK is performed on the database. The Recital command SET DELETED defines if the record will be displayed


EXAMPLE

The following example locks, deletes and then unlocks the current record.

#include "dbapi.h"
 
dbapi_dbf_delete()
{
    int	rc;
    int	recnum;
 
    if ( DBF_ISEXCLUSIVE() ) {
       _rc = DBF_DELETE();
    } else {
       recnum = DBF_RECNO();
       DBF_LOCKR( recnum );
       rc = DBF_DELETE();
       DBF_UNLOCKR( recnum );
    }
 
    _retl( rc );
}


SEE ALSO

DBF_DELETED(), DBF_FETCH(), DBF_FILTER(), DBF_GOTO(), DBF_ISEXCLUSIVE(), DBF_ISREADONLY(), DBF_LOCKF(), DBF_LOCKR(), DBF_RECALL(), DBF_RECNO(), DBF_SKIP(), DBF_UNLOCKF(), DBF_UNLOCKR()