Using an RWDBBulkInserter
The RWDBBulkInserter functions execute() and execute(size_t iters) cause values that are associated with each of the arrays shifted into self to be inserted into the table associated with self. The following example uses an RWDBBulkInserter to insert an array of strings and integers into a table.
 
// Define the arrays that will hold the data to be inserted
size_t length = 10;
RWDBTBuffer<RWCString> stringBuffer(length);
RWDBTBuffer<int> intBuffer(length);
 
// Populate the arrays using a user-defined function
setValues(stringBuffer, intBuffer);
 
// Define the inserter.
RWDBBulkInserter ins = table.bulkInserter(connection);
 
// Shift the arrays into the inserter
ins << stringBuffer << intBuffer;
 
// Insert up to length values at a time
RWDBResult result = ins.execute(length);
 
// The results of the insertion will now be visible to the
// reader
RWDBReader rdr = table.reader(connection);