Code Examples

Connecting to database (and error handling)
This example shows how to connect to/disconnect from databases using the library. It also shows how to handle errors.
Executing a simple SQL command
This example show the example of executing a simple query without any parameters and result set.
Binding input parameters
This example shows 2 methods for providing input parameters: direct assignment and stream-based.
Executing select query (and fetching result set)
This example shows how to process result set using SQLAPI++.
Binding LongBinary, LongChar, BLob and CLob data
This example shows 2 methods for binding Long or Lob data: traditional (bind all the data in one piece) and piecewise (using user defined callbacks for providing data).
Fetching LongBinary, LongChar, BLob and CLob data
This example shows 2 methods for fetching Long or Lob data: traditional (read all the data in one piece) and piecewise (using user defined callbacks for reading data).
Multithreading support and cancelling queries
This example shows how to create a thread with long running query.
Fetching records in bulk
This example demonstrates the use of "PreFetchRows" option to optimize the reading performance when returning back large result sets. The code fetches the data with and without the option and reports time spent in each case.
Using Oracle REF CURSORs
This example demonstrates how to get Oracle REF CURSORs from a stored procedure and than fetch it using SQLAPI++ library.
Using Oracle nested cursors
This example shows how SQLAPI++ handles queries with nested cursors.
Need Help?
Send an e-mail to support@sqlapi.com if you want to ask code-level questions, if you’re stuck with a specific error or need advise on the library best practices.