Product Documentation

c-treeDB API for C++ - Developers Guide

Previous Topic

Next Topic

CTRecord::NextBatch

Retrieves the next record from the batch buffer.

Declaration

void CTRecord::NextBatch()

Description

If the mode of the batch operation is 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 CTRecord::NextBatch() method.

CTRecord::NextBatch() method retrieves a record data from the batch buffer maintained by c-treeDB’s record object. After a successful call to CTRecord::NextBatch() method, the field data can be retrieved by calling the appropriate CTRecord::GetFieldAs...() methods.

In case of error, CTRecord::NextBatch() throws an exception.

Return

The user will receive an exception if the batch has ended.

Example

CTRecord hRecord;

while (true)

{

try

{

hRecord.NextBatch();

}

catch (CTException err)

{

if (err.GetErrorCode() == INOT_ERR)

break;

else

throw err;

}

CTString invoice = hRecord.GetFieldAsString("Invoice");

CTString item = hRecord.GetFieldAsString("Item");

printf("%-11s %s\n", invoice.c_str(), item.c_str());

}

See Also

CTRecord::BatchLoaded(), CTRecord::BatchLocked(), CTRecord::BatchMode(), CTRecord::BatchTotal(), CTRecord::EndBatch(), CTRecord::InsertBatch(), CTRecord::IsBatchActive(), CTRecord::SetBatch()

TOCIndex