Home How To Online Documentation Support Download Order


SQLAPI++ References

Quick download:

SQLAPI++ Windows

SQLAPI++ Linux



SQLAPI++ Solaris x86


SQLAPI++ Library

SQLAPI++ is a C++ library for accessing multiple SQL databases (Oracle, SQL Server, DB2, Sybase, Informix, InterBase, SQLBase, MySQL, PostgreSQL, SQLite, SQL Anywhere and ODBC). It uses native APIs of target DBMS so applications developed with SQLAPI++ library run swiftly and efficiently. The product also provides a low-level interface that allows developers to access database-specific features. By encapsulating a vendor's API, SQLAPI++ library acts as middleware and delivers database portability. See details on supporting SQL database servers on different platforms:

Server Windows Linux/Unix
Oracle Database Server Supported (OCI) Supported (OCI)
Microsoft SQL Server Supported (SQLNCLI/ODBC, OLE DB, DB-Library) SQLNCLI/ODBC for Linux x86-64, otherwise ODBC driver and connection should be used (FreeTDS, Easysoft,...)
Sybase Supported (Open Client, ASE & ASA) Supported (Open Client, ASE & ASA)
DB2 Supported (DB2 CLI) Supported (DB2 CLI)
Informix Supported (Informix CLI) Supported (Informix CLI)
InterBase/Firebird Supported Supported
SQLBase Supported (CAPI) Supported (CAPI)
MySQL, MariaDB Supported (MySQL C API)  Supported (MySQL C API)
PostgreSQL Supported (libpq) Supported (libpq)
ODBC Supported Supported (iODBC, unixODBC)
Sybase SQL Anywhere
Supported (SQL Anywhere C API)
Supported (SQL Anywhere C API)

Currently SQLAPI++ library supports the following C/C++ compilers:

  • Microsoft Visual C++
  • Embarcadero (Borland) C++
  • GNU GCC C++ compiler
  • Solaris Studio C++ compiler

Why use SQLAPI++?

  • SQLAPI++ directly calls native API's of target DBMSs (unlike ADO which uses OLEDB and/or ODBC intermediate layer). That's why SQLAPI++ is the fastest way to manage you data.
  • No need (vs ADO) to install and configure OLEDB and/or ODBC drivers when developing and distributing your applications.
  • Low-level interface that allows developers to access database-specific features.
  • SQLAPI++ ships with all the sources.
  • Free lifetime support, bugs fixing and new version updates.



Step 1. Connecting to database (and error handling)
Step 2. Executing a simple SQL command
Step 3. Binding input parameters
Step 4. Executing a select query (and fetching result set)
Step 5. Binding LongBinary, LongChar, BLob and CLob data
Step 6. Fetching LongBinary, LongChar, BLob and CLob data
Step 7. Multithreading support and canceling queries

Advanced Examples

Using Oracle REF CURSORs
Using Oracle nested cursors
Fetching records in bulk


28 December 2018

Version 4.2.4 of SQLAPI++ library released.

New features:

  • SQLServer (OLEDB): API code reorganized.
  • SQLServer (ODBC): API code reorganized.
  • SQLBase: API code reorganized.
  • Interbase: API code reorganized.
  • SQL Anywhere: API code reorganized.
  • DB2: API code reorganized (special "STATIC" value for "DB2CLI.LIBS" option).
  • Informix: API code reorganized (special "STATIC" value for "INFCLI.LIBS" option).
  • Oracle: OCI8 code reorganized (special "STATIC" value for "OCI8.LIBS" option).
  • Oracle: Added support for Implicit Results (thanks Georgiy Pakhutin).
  • Oracle: Do not read timezone data for for the date/type types without it because this is too slow (thanks Sven REUTTER).
  • Sybase: API code reorganized (special "STATIC" value for "SYBCT.LIBS" option).
  • CubeSQL: API code reorganized (special "STATIC" value for "CUBESQL.LIBS" option).
  • PostgreSQL: API code reorganized (special "STATIC" value for "LIBPQ.LIBS" option).
  • SQLite: Added code to detect if the field in the result set is required (thanks Karoly Harmath).
  • SQLite: API code reorganized (special "STATIC" value for "SQLITE.LIBS" option).
  • MySQL: API code reorganized (special "STATIC" value for "MYSQL.LIBS" option).
  • General: Sources split.
  • SQLServer (ODBC): Fixed multi-result command procesing (Brendan Wilson).
  • ODBC: Fixed input string buffer processing (thanks Alexander Goldnik).
  • SQLServer (ODBC): Fixed bug with stored procedures have the output parameters and result sets with LOB fields (thanks Mike Moening).
20 September 2018

Version 4.2.3 of SQLAPI++ library released.

New features:

  • General: Added SAConnection::GetNextCommand method (enumerates SACommand-s).
  • General: SA_USE_STL build option uses a map for input parameter names (improved performance for parameter by name searching).
  • CubeSQL: Fixed setAutoCommit method (thanks Christian Schmitz).
  • ODBC: Fixed input buffer length for SA_dtString (thanks Christian Schmitz).
  • Sybase: Fixed connection problem related to OCS error messages 5701 and 5704 (thanks CK Yang).
  • General: Optimized parameters parsing/creation algorithm for numeric binding parameter names.
  • PostgreSQL: RefCursor implementation (thanks Danielle Gutfinger).
  • CubeSQL: Added cubeSqlAPI::SetTraceFunction method (thanks Christian Schmitz).
  • CubeSQL: Use GetUTF8Chars instead of GetMultiByteChars for Unicode SQLAPI (thanks Christian Schmitz).
5 April 2018

Version 4.2.2 of SQLAPI++ library released.

New features:

  • SQLServer: Support for Microsoft ODBC Driver 17 for SQL Server on Windows.
  • ODBC: Fixed binding terminated null character (thanks Jarek Karciarz).
  • SQL Anywhere: Support for API version 1 (thanks Christian Schmitz).
  • InterBase: Fixed bug for modern InterBase versions without older XSQLVAR_V1 and SQLDA_VERSION1 support.
  • InterBase: Fixed bug with boolean type differences for InterBase and Firebird.
19 December 2017

Version 4.2.1 of SQLAPI++ library released.

New features:

  • CubeSQL: Added experimental support of CubeSQL.
  • PostgreSQL: Microseconds instead of milliseconds used for the datetime values (thansk Sun-ho Lee).
  • Oracle: Now UNICODE SQLAPI processes "OCI_ATTR_CHARSET_FORM" option so "SQLCS_IMPLICIT" value can be used instead of default "SQLCS_NCHAR".
  • ODBC: Added "ODBCDisableLongLengthQuery" option to avoid crashes in incorrect ODBC drivers (thanks Christian Schmitz).
  • ODBC: Added odbcExternalConnection class.
  • SQLServer(ODBC): Auto-detect original connection string format.
  • SQLite: Fixed bug with multi-command statement syntax parsing (thanks Christian Schmitz).
  • MySQL: Use character set option before the connection established (username/password can contains not only ASCII characters, thank Bojan Hrnkas).
  • SQL Anywhere: Use the connection mutex with the cursor to prevent 42W22 error.
  • SQL Anywhere: Fixed setup auto-commit mode (thanks Peter Koukoulis).
30 August 2017

Version 4.1.12 of SQLAPI++ library released.

New features:

  • PostgreSQL: Corrected numeric field precision/scale(set -1) length(set 0) values when they are not defined by the server (thanks Peter Koukoulis).
  • General: Added Intel Compiler build scripts (thanks Luca Teodori).
  • SQL Anywhere: Use thread-safe library on Linux/Unix (thanks Peter Koukoulis).
  • Informix: Fixed data length/indicator size (thanks Florian Apolloner).
  • Informix: Fixed memory leak with SQLAttributeCol using according to IBM IT21378 (thanks Florian Apolloner).
  • SQLServer(OLEDB): Added ssOleDbAPI::ProcessSQLServerErrorInfo() property that allows to exclude SQL Server erro iformation processing.
  • MySQL: Added for loading by default also MariaDB client library (thanks Daniel Hideghethy).
  • SQLite: Initail support for multi-command queries.
  • SQLite: Added 'sqlite3_memory_used' and 'sqlite3_memory_highwater' native API functions (thanks Christian Schmitz).
  • SQL Anywhere: SAConnection::setAutoCommit() command fixed (thanks Peter Koukoulis).
  • SQLServer(ODBC): Added "SQL_COPT_SS_PRESERVE_CURSORS" connection option.
  • General: Fixed character parameter type binding for all ODBC API (thanks Morten Sřlvberg).
  • SQLServer(ODBC): Fixed bug with multi-result statemets and LONG/LOB field dadata fetching (thanks Frederick Couste)
14 April 2017

Version 4.1.11 of SQLAPI++ library released.

New features:

  • General: Fixed bug with ODBC/CLI API and multiresult statement field binding (thanks Raymond Allen).
  • General: Added build fiels for IBM xlC compiler, fixed DBMS lib names for AIX (thanks Ralph Dagdag).
  • SQLServer(ODBC): Fixed problem with incorrect driver version number reported by sqlsrv32.dll (thanks Matt Fisher).
  • Informix: Added support for "PreFetchRows" option.
  • ODBC, DB2, Informix, SQLServer(ODBC): added "ExecDirect" SACommand option (use SQLExecDirect instead of SQLExecute).
  • ODBC: fixed SQL_ATTR_ROWS_FETCHED_PTR attribute setup bug (thanks Ivano Cassis).
  • PostgreSQL: Added "SetCursorName" command option.
  • SQLServer (ODBC): Added support for Microsoft ODBC Driver 13 for SQL Server.
  • ODBC: Fixed long text data length detection for Unicode variant (thanks Bjoern Eggstein).
  • SQL Anywhere: Fixed bug with procedure/function parameters parsing (thanks Trent Bowman).
  • General: Fixed UTF-8 mode of SAMultibyte2UnicodeConverter (thanks Emma Qin)
  • General: Fixed quoted parameter name parsing (like :"my param", thanks Vyacheslav E.)
  • InterBase: Fixed UTF-8 character set name (thanks Maria Harmon).
4 October 2016

Version 4.1.10 of SQLAPI++ library released.

New features:

  • General: Fixed SAInterval internals.
  • MySQL: Fixed statement API SA_dtInteral binding (thanks Sophia Wang).
  • SQL Anywhere: Fixed bug with prepared statement execution (thanks Brad Blankenburg).
  • SQLite: Added sqlite3_load_extension and sqlite3_free API functions.
  • MySQL: Fixed bug with the first SACommand::FetchPrior() call (thanks Dave Sulentic).
  • PostgreSQL: Ignore unknown date/time formats (thanks Maria Harmon).
  • MySQL: For multi-thread version try to load also MYSQL client lirary name without "_r" suffix (thanks Michael Noe).
  • General: Added SA_STATIC_PGSQL build option.
  • MySQL: Added MYSQL_SHARED_MEMORY_BASE_NAME connection option.
4 May 2016

Version 4.1.9 of SQLAPI++ library released.

New features:

  • Oracle: Fixed bug with CLOB reading and using multi-byte client encoding (thanks Peter Klotz).
27 April 2016

Version 4.1.8 of SQLAPI++ library released.

New features:

  • Sybase: Fixed bug with ASE 16.x version detection (thanks Frank Hilliger).
  • General: Fixed utf8.c code for correct results with and without output buffer, Unicode 3.0 standards (thanks Peter Klotz).
  • General: Fixed SAComand::Field(index) throws SAException when index is wrong (Christian Schmitz).
  • PostgreSQL: fixed using "APPNAME" connection option when connection string dbname already includes other options.
  • Oracle: try to get the LOB size before read.
  • General: added missed 'SAValueRead::operator SANumeric() const' body (thanks Balázs Kádár).
  • General: fixed SIZE_MAX definition bug (thanks Peter Klotz).
  • General: Fixed the SAString::SetUTF16Chars method for correct new []/delete [] (thanks Matt Feemster).

See Full History...

Last modified: 20 SeptemLast modified: 28 December 2018