Product Documentation

FairCom DB API for C

Previous Topic

Next Topic

ctdbLastRecord

Get the last record on a table.

Declaration

CTDBRET ctdbLastRecord(CTHANDLE Handle)

Description

ctdbLastRecord() retrieves the last record on a table and copies the record data from disk into the specified record handle’s record buffer, and sets the current record to that last record.

  • Handle [in] the record handle.

If sets are enabled by ctdbRecordSetOn(), ctdbLastRecord() will retrieve the last record in the set. Use ctdbFirstRecord() to retrieve the first record on a table, ctdbNextRecord() to retrieve the next record on a table, and ctdbPrevRecord() to retrieve the previous record on a table. Use ctdbFindRecord() to find a specific record on a table. Note that if session-wide record locking is enabled, this function will also lock the record it retrieves.

Returns

ctdbLastRecord() returns CTDBRET_OK on success, or INOT_ERR (101) if the table is empty, or a FairCom DB API error on failure.

See also

ctdbAllocRecord(), ctdbFirstRecord(), ctdbNextRecord(), ctdbPrevRecord(), ctdbFindRecord(), ctdbRecordSetOn()

TOCIndex