Product Documentation

FairCom DB API for C

Previous Topic

Next Topic

ctdbBatchLoaded

Retrieves the number of batch records loaded into batch buffer.

DECLARATION

LONG ctdbDECL ctdbBatchLoaded(CTHANDLE Handle);

DESCRIPTION

ctdbBatchLoaded() retrieves the number of batch records loaded into batch buffer for CTBATCH_GET, CTBATCH_RANGE or CTBATCH_PHYS operations. This is the number of records that are ready to be retrieved by ctdbNextBatch() function.

Handle must be a record handle associated with an opened table.

RETURNS

ctdbBatchLoaded() returns the number of records ready for retrieval or a negative value indicating an error. In case of an error, use the ctdbGetError() function to retrieve the error code.

EXAMPLE

/* set the partial target key */

ctdbClearRecord(hRecord);

ctdbSetFieldAsSigned(hRecord, 0, Invoice);

/* set the batch operation */

if (ctdbSetBatch(hRecord, CTBATCH_GET, sizeof(Invoice), 0) != CTDBRET_OK)

printf("ctdbSetBatch failed with error %d\n", ctdbGetError(hRecord));

/* show how many records are ready */

printf("%d records are ready for retrieval\n", ctdbBatchLoaded(hRecord));

SEE ALSO

ctdbBatchLocked(), ctdbBatchMode(), ctdbBatchTotal(), ctdbEndBatch(), ctdbInsertBatch(),
ctdbIsBatchActive(), ctdbNextBatch(), ctdbSetBatch()

TOCIndex