ctdbNextBatch
Retrieves the next record from batch buffer.
DECLARATION
CTDBRET ctdbDECL ctdbNextBatch(CTHANDLE Handle);
DESCRIPTION
If the mode of the batch operation is one of CTBATCH_GET, CTBATCH_RANGE or CTBATCH_PHYS then it may be necessary to retrieve all records that match the batch criteria. The records are retrieved by calling the ctdbNextBatch() function.
The ctdbNextBatch() function retrieves the record data from the batch buffer maintained by FairCom DB API’s record handle. After a successful call to the ctdbNextBatch() function the field data can be retrieved by calling the appropriate ctdbGetFieldAs..() functions.
Handle must be a record handle associated with an opened table.
RETURNS
Value |
Symbolic Constant |
Explanation |
---|---|---|
0 |
CTDBRET_OK |
No error occurred. |
428 |
BTMT_ERR |
No more records can be retrieved. (Indicates every record in batch was retrieved.) |
See Appendix A for a complete listing of valid c-tree Plus error values.
EXAMPLE
/* retrieve records */
while (ctdbNextBatch(hRecord) == CTDBRET_OK)
{
TEXT invoice[32], item[32];
ctdbGetFieldAsString(hRecord, 0, invoice, sizeof(invoice));
ctdbGetFieldAsString(hRecord, 1, item, sizeof(item));
printf("%-11s %s\n", invoice, item);
}
SEE ALSO
ctdbBatchLoaded(), ctdbBatchLocked(), ctdbBatchMode(), ctdbBatchTotal(), ctdbEndBatch(),
ctdbInsertBatch(), ctdbIsBatchActive(), ctdbSetBatch()