DBF UPDATE()

From Lianjapedia
Jump to: navigation, search

PURPOSE

Flush current record buffer to disk

SYNONYM

api_dbf_update()

SYNOPSIS

#include "lianja_api.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 table is opened for shared access, the record must be locked first.

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

The Update trigger will be called if one has been specified for the table. The update operation will then only be completed successfully once the 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 "lianja_api.h"
 
lianjaapi_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()