ctdbEndBatch
Terminates or cancels a batch operation.
DECLARATION
CTDBRET ctdbDECL ctdbEndBatch(CTHANDLE Handle);
DESCRIPTION
A batch operation must be terminated by calling the ctdbEndBatch() function. Once a batch operation is started with ctdbSetBatch(), no other batch operation is allowed to start until the current batch operation is terminated.
When performing batch retrieval operations, you may cancel the batch operation before retrieving all the records by calling ctdbEndBatch().
If the batch operation is a CTBATCH_RANGE then you must also call ctdbRecordRangeOff() function to terminate the index range used for the batch operation.
Handle must be a c-treeDB API record handle associated with an opened table.
RETURNS
Value |
Symbolic Constant |
Explanation |
---|---|---|
0 |
NO_ERROR |
No error occurred. |
See Appendix A for a complete listing of valid c-tree Plus error values.
EXAMPLE
/* set the partial target key */
ctdbClearRecord(hRecord);
ctdbSetFieldAsSigned(hRecord, 0, Invoice);
/* set the batch operation */
if (ctdbSetBatch(hRecord, CTBATCH_DEL, sizeof(Invoice), 0) != CTDBRET_OK)
printf("ctdbSetBatch failed with error %d\n", ctdbGetError(hRecord));
/* end the batch operation */
if (ctdbEndBatch(hRecord) != CTDBRET_OK)
printf("ctdbEndBatch failed with error %d\n", ctdbGetError(hRecord));
SEE ALSO
ctdbBatchLoaded(), ctdbBatchLocked(), ctdbBatchMode(), ctdbBatchTotal(), ctdbInsertBatch(),
ctdbIsBatchActive(), ctdbNextBatch(), ctdbSetBatch()