Product Documentation

c-treeDB API for C++ - Developers Guide

Previous Topic

Next Topic

CTRecord::BatchTotal

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

Declaration

LONG CTRecord::BatchTotal();

Description

CTRecord::BatchTotal() retrieves the total number of records selected by a batch retrieval operation. If a batch operation is not active, CTRecord::BatchTotal() returns zero.

Return

Returns the total number of records selected by a batch retrieval operation. In case of an error, CTRecord::BatchTotal() throws a CTException.

Example


try

{

// set the partial target key

hRecord.Clear();

hRecord.SetFieldAsSigned("Invoice", Invoice);

// set the batch operation

hRecord.SetBatch(CTBATCH_GET, sizeof(Invoice), 0);

// show how many records are ready

printf("%d records total\n", hRecord.BatchLocked());

}

catch (CTException& err)

{

printf("Batch failed with error %d\n", hRecord.GetError());

}

See Also

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

TOCIndex