Product Documentation

FairCom DB API for C

Previous Topic

Next Topic

ctdbBatchTotal

Retrieves the total number of records affected by a batch retrieval operation.

DECLARATION

LONG ctdbDECL ctdbBatchTotal(CTHANDLE Handle);

DESCRIPTION

ctdbBatchTotal() retrieves the total number of records selected by a batch retrieval operation. If a batch operation is not active, ctdbBatchTotal() returns zero. Handle must be a record handle associated with an opened table.

RETURNS

Returns the total number of records selected by a batch retrieval operation. In case of an error, ctdbBatchLocked() returns a negative value and you may use ctdbGetError() function to retrieve the error code.

EXAMPLE

ctdbClearRecord(hRecord);

ctdbSetFieldAsSigned(hRecord, 0, Invoice);


/* set the batch operation */

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

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


/* show total number of records */

printf("%d records selected\n", ctdbBatchTotal(hRecord));

SEE ALSO

ctdbBatchLoaded ctdbBatchLocked ctdbBatchMode ctdbEndBatch ctdbInsertBatch ctdbIsBatchActive ctdbNextBatch ctdbSetBatch

TOCIndex