Simba Technologies
Simba Technologies

SimbaEngine X SDK 10.1.11
Developing Drivers for SQL-Capable Data Stores

Bulk Fetch in the C++ SDK

Prior to SimbaEngine SDK 10.0, data had to be retrieved from an IResult row by row and column by column using the Move method to position the cursor, and RetrieveData to return a cell of data. Retrieving data in this manner is acceptable for small‑to‑medium sized datasets, or those with results spanning non‑contiguous rows, but has the following drawbacks:

  • Data is accessed per cell, which means the ODBC layer of the SDK needs to loop through each row and each column, invoking methods to retrieve and convert each individual cell of data. This results in a large number of small data transfers, with each of them requiring a small amount of overhead, but collectively resulting in a noticeable impact on performance.
  • The retrieval of each data cell involves invoking multiple virtual methods, which can stall a CPU’s instruction pipeline and decrease a driver’s execution performance.

As of 10.0, IResult now exposes the Bulk Fetch API which provides a more optimized data retrieval mechanism allowing a driver to fetch contiguous rows of data via a single method call and store the data directly into the buffer allocated by the calling application. This “bulk fetch” mechanism eliminates the need to iterate over rows and columns to return data and allows all the data for many rows to be returned in one pass.


  • Bulk fetch is currently supported for ODBC drivers that do not use the SQL Engine and are not implemented by the Simba SDK’s ODBC Client. Bulk Fetch can be implemented in SimbaServer, as described below.
  • Bulk fetch is supported in the C++ SDK only.