Introduction to the SQL Anywhere C API version 1.0

The SQL Anywhere C application programming interface (API) simplifies the creation of C and C++ wrapper drivers for several interpreted programming languages including PHP, Perl, Python, and Ruby. The SQL Anywhere C API is layered on top of the DBLIB package and it was implemented with Embedded SQL.

Although it is not a replacement for DBLIB, the SQL Anywhere C API simplifies the creation of applications using C and C++. You do not need an advanced knowledge of embedded SQL to use the SQL Anywhere C API. For more information about implementation, see sqlany_imp.sqc.

API distribution

The API is built as a dynamic link library (DLL) (dbcapi.dll) on Microsoft Windows systems and as a shared object (libdbcapi.so) on Unix systems. The DLL is statically linked to the DBLIB package of the SQL Anywhere version on which it is built. When the dbcapi.dll file is loaded, the corresponding dblibX.dll file is loaded by the operating system. Applications using dbcapi.dll can either link directly to it or load it dynamically.

Descriptions of the SQL Anywhere C API data types and entry points are provided in the main header file (sacapi.h).

Threading support

The SQL Anywhere C API library is thread-unaware; the library does not perform any tasks that require mutual exclusion. To allow the library to work in threaded applications, only one request is allowed on a single connection. With this rule, the application is responsible for doing mutual exclusion when accessing any connection-specific resource. This includes connection handles, prepared statements, and result set objects.


Loading the interface library dynamically