DBF UPDATE()

From Recital Documentation Wiki
Revision as of 16:56, 27 March 2009 by Yvonnemilne (Talk | contribs)

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

PURPOSE

Flush current record buffer to disk


SYNONYM

api_dbf_update()


SYNOPSIS

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


DESCRIPTION

The DBF_UPDATE() function will flush the current record buffer to disk. If the database is opened for shared access, the record must be locked first.

All active indexes on the database will be updated and the record pointer will be repositioned.

The Update trigger will be called if one has been specified for the database. The update operation will then only be completed successfully once the Recital procedure has been executed and .T. is returned.

Before or after image journaling will also be updated if either is active.

The record buffer is updated from the BLOB_UPDATE(), BLOB_WRITE(), DBF_GATHER(), DBF_READ(), FIELD_UPDATE(), MEMO_UPDATE() and MEMO_WRITE() functions. The DBF_RECBUFFER() function will return the contents of the current record buffer.


EXAMPLE

The following example locks the current record then flushes the record buffer to disk.

#include "dbapi.h"
 
dbapi_dbf_update()
{
    int	rc;
 
    if (DBF_ISEXCLUSIVE()) {
       rc = DBF_UPDATE();
    } else {
       DBF_LOCKR(DBF_RECNO());
       rc = DBF_UPDATE();
       DBF_UNLOCKR(DBF_RECNO());
    }
 
    _retni( rc );
}


SEE ALSO

BLOB_UPDATE(), BLOB_WRITE(), DBF_APPEND(), DBF_DELETE(), DBF_ISEXCLUSIVE(), DBF_ISREADONLY(), DBF_LOCKF(), DBF_LOCKR(), DBF_RECALL(), DBF_UNLOCKF(), DBF_LOCKR(), FIELD_UPDATE(), MEMO_UPDATE(), MEMO_WRITE()