The DBTools.h++ Sybase CT access library supports bulk reading through the array interface provided by the Sybase Open Client function, ct_bind(). Bulk writing is supported through the array interface provided by the Sybase Bulk-Library function, blk_bind(), which is part of the Sybase Open Client/Open Server common libraries.
The RWDBDateVector produced by an RWDBDatabase associated with the DBTools.h++ Sybase CT access library encapsulates collections of the Client-Library datatype CS_DATETIME*.
The RWDBBinaryVector filled in by RWDBBulkReader can determine the specific data length of each of its elements. The RWDBBulkInserter associated with the DBTools.h++ Sybase CT access library can accept RWDBBinaryVectors with elements of widths up to 64K. Elements with width greater than 64K may corrupt the database.
The RWDBBulkInserter functions execute() and execute(int 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 int width = 80; int length = 10; RWDBStringVector stringVector(width, length); RWDBTVector<int> intVector(length); // Populate the arrays using a user-defined function setValues(stringVector, intVector); // Start scope of the inserter { // Define the inserter. RWDBBulkInserter ins = table.bulkInserter(connection); // Shift the arrays into the inserter ins << stringVector << intVector; // Insert up to length values at a time RWDBResult result = ins.execute(length); } // End the scope of the inserter so that the destructor // will be invoked. // The results of the insertion will now be visible to the // reader RWDBReader rdr = table.reader(connection);
©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.