### Getting Native PostgreSQL Command Handles Source: https://www.sqlapi.com/ApiDoc/pgsql Retrieving native PostgreSQL command-related handles via `SACommand::NativeHandles` for integration with PostgreSQL API functions. ```APIDOC ## Getting Native PostgreSQL Command Related Handles ### Description Use native API handles when you need to call specific PostgreSQL API functions that are not directly supported by the library. API functions typically require one or more active handles as parameters. The `SACommand::NativeHandles` method returns a pointer to the set of native API **command related** handles. To use these API handles directly, you must downcast the `saCommandHandles` pointer to the appropriate type and use its implementation-specific members. ### Method `SACommand::NativeHandles()` ### Example Usage To access native command handles, include the PostgreSQL-specific header and cast the result of `SACommand::NativeHandles` to the `pgCommandHandles` class: ```cpp #include "pgAPI.h" saCommandHandles *pHandles = cmd.NativeHandles(); pgCommandHandles *pNativeHandles = (pgCommandHandles*)pHandles; ``` For more information about PostgreSQL API functions and handles, consult the PostgreSQL-specific documentation. ### Related Information - `SACommand::NativeHandles` - PostgreSQL specific documentation ``` -------------------------------- ### Get Native SQL Server (OLEDB) Command Handles with SQLAPI++ Source: https://www.sqlapi.com/ApiDoc/mssql_oledb This example shows how to obtain native command-related handles for SQL Server (OLEDB) via SACommand::NativeHandles. Similar to connection handles, it requires including 'ssOleDbAPI.h' and casting the saCommandHandles pointer to ssOleDbCommandHandles. These handles are essential for using SQL Server (OLEDB) API functions that operate on command objects. ```cpp #include "ssOleDbAPI.h" saCommandHandles *pHandles = cmd.NativeHandles(); ssOleDbCommandHandles *pNativeHandles = (ssOleDbCommandHandles*)pHandles; ``` -------------------------------- ### Getting Native PostgreSQL Connection Handles Source: https://www.sqlapi.com/ApiDoc/pgsql Accessing native PostgreSQL connection-related handles using `SAConnection::NativeHandles` for direct use with PostgreSQL API functions. ```APIDOC ## Getting Native PostgreSQL Connection Related Handles ### Description Use native API handles when you need to call specific PostgreSQL API functions that are not directly supported by the library. API functions typically require one or more active handles as parameters. The `SAConnection::NativeHandles` method returns a pointer to the set of native API **connection related** handles. To use these API handles directly, you must downcast the `saConnectionHandles` pointer to the appropriate type and use its implementation-specific members. ### Method `SAConnection::NativeHandles()` ### Example Usage To access native connection handles, include the PostgreSQL-specific header and cast the result of `SAConnection::NativeHandles` to the `pgConnectionHandles` class: ```cpp #include "pgAPI.h" saConnectionHandles *pHandles = con.NativeHandles(); pgConnectionHandles *pNativeHandles = (pgConnectionHandles*)pHandles; ``` For more information about PostgreSQL API functions and handles, consult the PostgreSQL-specific documentation. ### Related Information - `SAConnection::NativeHandles` - PostgreSQL specific documentation ``` -------------------------------- ### SQLAPI++ Server Specific Guides Source: https://www.sqlapi.com/ApiDoc/class_s_a_long_binary Guides for integrating SQLAPI++ with various database servers. ```APIDOC ## SQLAPI++ Server Specific Guides ### Description This section details the integration and usage of SQLAPI++ with a wide range of database servers. ### Supported Databases - Oracle - SQL Server - DB2 - Sybase - MySQL - PostgreSQL - SQLite - Informix - InterBase / Firebird - SQLBase - SQL Anywhere - ODBC - MariaDB - cubeSQL - DuckDB - OLEDB ### Usage Notes Each database may have specific connection string formats, driver configurations, or SQL dialect considerations. Refer to the specific database documentation for details on: - **Connection Parameters**: Host, port, database name, username, password, etc. - **Driver Loading**: How to load the appropriate database driver. - **SQL Dialect**: Any specific syntax or function differences. - **Data Type Mapping**: How SQL data types map to SQLAPI++ types. ``` -------------------------------- ### SQLAPI++ Server Specific Guides Source: https://www.sqlapi.com/ApiDoc/classsa_connection_handles Guides and connection handle information for various database management systems supported by SQLAPI++. ```APIDOC ## SQLAPI++ Server Specific Guides ### Description This section provides information on connecting to and working with various database management systems using SQLAPI++. ### Supported Databases - Oracle - SQL Server - DB2 - Sybase - MySQL - PostgreSQL - SQLite - Informix - InterBase / Firebird - SQLBase - SQL Anywhere - ODBC - MariaDB - cubeSQL - DuckDB - OLEDB ### Connection Handle Base Class #### Base class for DBMS specific connection handle(s). ##### Detailed Description Base class for DBMS specific connection handle(s). ##### Inheritance Inherited by asaConnectionHandles, cubeSqlConnectionHandles, db2ConnectionHandles, duckdbConnectionHandles, ibConnectionHandles, infConnectionHandles, mdbConnectionHandles, myConnectionHandles, odbcConnectionHandles, oledbConnectionHandles, oraConnectionHandles, pgConnectionHandles, sb6ConnectionHandles, sl3ConnectionHandles, ssNCliConnectionHandles, ssOleDbConnectionHandles, and sybConnectionHandles. ``` -------------------------------- ### SQLAPI Server Specific Guides Source: https://www.sqlapi.com/ApiDoc/class_s_a_long_or_lob Guides and support for connecting SQLAPI++ to various database servers. ```APIDOC ## SQLAPI Server Specific Guides ### Description This section provides information and guides for integrating SQLAPI++ with a wide range of database management systems. ### Supported Databases - Oracle - SQL Server - DB2 - Sybase - MySQL - PostgreSQL - SQLite - Informix - InterBase / Firebird - SQLBase - SQL Anywhere - ODBC - MariaDB - cubeSQL - DuckDB - OLEDB ``` -------------------------------- ### Server Specific Guides Source: https://www.sqlapi.com/ApiDoc/class_s_a_bytes Guides for integrating SQLAPI++ with various database servers, including Oracle, SQL Server, MySQL, PostgreSQL, SQLite, and more. ```APIDOC ## Server Specific Guides ### Description Detailed instructions and considerations for using SQLAPI++ with a wide range of database systems. ### Supported Servers - Oracle - SQL Server - DB2 - Sybase - MySQL - PostgreSQL - SQLite - Informix - InterBase / Firebird - SQLBase - SQL Anywhere - ODBC - MariaDB - cubeSQL - DuckDB - OLEDB ``` -------------------------------- ### SQL Server (ODBC) Guide Source: https://www.sqlapi.com/ApiDoc/mssql_odbc This section details how to connect to a SQL Server database using the SQLAPI++ library with the ODBC API. It covers the default API behavior, minimum version requirements, and the parameters for the SAConnection::Connect method. ```APIDOC ## Connecting to a database To connect to a database you need to initialize a connection object. A connection object is represented by SAConnection class. ### Default API Starting from version 4.0.3 SQLAPI++ library uses ODBC as default API when working with SQL Server. It means that the library sets the default value of `UseAPI` connection option as `"ODBC"`. If the library cannot find ODBC interface it throws an exception. ### Minimum Version SQLAPI++ library requires SQLServer ODBC version 2000.x or SQL Server Native Client (ODBC API) version 2005 and higher. After the connection is created you need to call SAConnection::Connect method to establish connection with **SQL Server** server: ```cpp void Connect( const SAString &sDBString, const SAString &sUserID, const SAString &sPassword, SAClient_t eSAClient = SA_Client_NotSpecified); ``` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None **sDBString** (SAString) - Connection string in the following format: ``` [@][][;] ``` * `` - connects to a specified server. If it's omitted SQLAPI++ tries to connect to default local server instance * `` - connects to a database with the specified name. If it's omitted SQLAPI++ tries to connect to default database * `` - SQL Server Native ODBC driver specific option list To connect to a named instance of SQL Server use `` instead of `` (use double back slash in C++ constants, for example `"MyServer\\SQLEXPRESS@pubs"`). Since SQLNCLI (SQL Server 2005) also available protocol specific server name part of the connection string: * `lpc:[\]` - using shared memory * `tcp:[\],` or `tcp:[\],` - using TCP/IP * `np:\\pipe\` or `np:\\pipe\` - using named pipes * `via:[\instancename],:` - using VIA **sUserID** (SAString) - A string containing a user name to use when establishing the connection. If `sUserID` parameter is empty, SQLAPI++ library requests a secure, or trusted, connection to SQL Server. **sPassword** (SAString) - A string containing a password to use when establishing the connection. **eSAClient** (SAClient_t) - Optional. One of the following values from SAClient_t enum: * `SA_SQLServer_Client` – SQL Server client * `SA_Client_NotSpecified` – used by default if `eSAClient` parameter is omitted. You can use this default value only if you have SAConnection::setAPI method with SAPI object initialized with `SA_SQLServer_Client` constant before For more details see Getting Started - Connect to Database, SAConnection object, SAConnection::Connect. ### Request Example ```json { "example": "void Connect(const SAString &sDBString, const SAString &sUserID, const SAString &sPassword, SAClient_t eSAClient = SA_Client_NotSpecified);" } ``` ### Response #### Success Response (200) No specific response body is documented for the connect method itself, but successful execution establishes a database connection. #### Response Example ```json { "example": "// Connection established successfully" } ``` ``` -------------------------------- ### Getting Native DuckDB Connection Related Handles Source: https://www.sqlapi.com/ApiDoc/duckdb This section guides on how to retrieve native DuckDB connection handles to use specific API functions that require them as parameters. ```APIDOC ## Getting Native DuckDB Connection Related Handles ### Description You have to use native API handles when you want to call specific DuckDB API functions which are not directly supported by the library. API functions usually need to receive one or more active handles as parameters. SAConnection::NativeHandles method returns a pointer to the set of native API **connection related** handles. To use API handles directly, you have to downcast saConnectionHandles pointer to the appropriate type and use its implementation-specific members. ### Example ```cpp #include "duckdbAPI.h" saConnectionHandles *pHandles = con.NativeHandles(); duckdbConnectionHandles *pNativeHandles = (duckdbConnectionHandles*)pHandles; ``` ### See Also - SAConnection::NativeHandles - DuckDB specific documentation ``` -------------------------------- ### SQLAPI++ Tracing Setup Source: https://www.sqlapi.com/ApiDoc/class_s_a_globals Configure a callback function for SQLAPI++ library tracing. ```APIDOC ## POST /sqlapi++/trace/setup ### Description Sets up a callback function for the SQLAPI++ library's tracing mechanism. This allows developers to intercept and process tracing information generated by the library for debugging or monitoring purposes. ### Method POST ### Endpoint /sqlapi++/trace/setup ### Parameters #### Query Parameters None #### Request Body - **traceFunction** (string) - The identifier or endpoint for the tracing callback function. This would typically be a URL or a reference to a registered function. - **userData** (any) - Optional user-defined data pointer to be passed along with the trace information to the callback function. ### Request Example ```json { "traceFunction": "/my_trace_handler", "userData": {"sessionId": "12345"} } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation that the trace function has been set up. #### Response Example ```json { "message": "Tracing callback function set up successfully." } ``` ``` -------------------------------- ### Getting Native DB2 Command Handles Source: https://www.sqlapi.com/ApiDoc/db2 This section explains how to get native DB2 command-related handles using `SACommand::NativeHandles()`. These handles are required for specific DB2 API functions that operate on commands. ```APIDOC ## GET /websites/sqlapi_apidoc/native-db2-command-handles ### Description Retrieves native DB2 command handles via `SACommand::NativeHandles()`. These handles are necessary for calling specific DB2 API functions that require command-related parameters. The returned `saCommandHandles` pointer must be cast to `db2CommandHandles`. ### Method GET ### Endpoint `/websites/sqlapi_apidoc/native-db2-command-handles` ### Parameters #### Query Parameters - **cmd** (object) - Required - The `SACommand` object for which to get native handles. ### Response #### Success Response (200) - **handles** (object) - A pointer to the native DB2 command handles, cast to `db2CommandHandles`. #### Response Example ```json { "handles": "" } ``` ``` -------------------------------- ### Getting Native MariaDB Command Handles Source: https://www.sqlapi.com/ApiDoc/mariadb This section describes how to obtain native MariaDB command-related handles. These handles are crucial for invoking MariaDB API functions that require command context. It details the process of getting the handles and casting them to the `mdbCommandHandles` type. ```APIDOC ## GET /websites/sqlapi_apidoc/mariadb/nativehandles/command ### Description Retrieves native MariaDB command-related handles for use with MariaDB-specific API functions. ### Method GET ### Endpoint /websites/sqlapi_apidoc/mariadb/nativehandles/command ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ``` (No request body for this operation) ``` ### Response #### Success Response (200) - **pNativeHandles** (pointer to mdbCommandHandles) - A pointer to the MariaDB native command handles. #### Response Example ```json { "message": "Native MariaDB command handles available via pointer.", "pNativeHandles": "" } ``` ### Example Usage ```cpp #include "mdbAPI.h" // Assuming 'cmd' is an initialized SACommand object saCommandHandles *pHandles = cmd.NativeHandles(); mdbCommandHandles *pNativeHandles = (mdbCommandHandles*)pHandles; // Now you can use pNativeHandles with MariaDB API functions ``` ``` -------------------------------- ### Getting Native MySQL Command Handles Source: https://www.sqlapi.com/ApiDoc/mysql Retrieves native MySQL command handles for direct interaction with MySQL API functions not supported by SQLAPI++. ```APIDOC ## Getting Native MySQL Command Handles ### Description This endpoint allows you to obtain native MySQL command handles. These handles are essential for executing MySQL API functions that are not directly implemented or exposed by the SQLAPI++ library, providing deeper control over command execution. ### Method GET (Implied, as it's accessing an existing object's handles) ### Endpoint `cmd.NativeHandles()` (Conceptual, as it's a method call on a `SACommand` object) ### Parameters None directly for the endpoint, but operates on an existing `SACommand` object (`cmd`). ### Request Example ```cpp #include "myAPI.h" saCommandHandles *pHandles = cmd.NativeHandles(); myCommandHandles *pNativeHandles = (myCommandHandles*)pHandles; // Use pNativeHandles for MySQL-specific command API calls ``` ### Response #### Success Response - **pHandles** (`saCommandHandles*`) - A pointer to the set of native API command-related handles. #### Response Example ```cpp // The result of cmd.NativeHandles() is a pointer that needs to be cast // to the specific MySQL handle type (myCommandHandles*). ``` ### Additional Information Consult the MySQL-specific documentation for detailed information on the available MySQL API functions and handles accessible via `myCommandHandles`. Refer to the SQLAPI++ documentation for further details on the `SACommand::NativeHandles` method. ``` -------------------------------- ### SQLBase Connection, Command, and Parameter Options Source: https://www.sqlapi.com/ApiDoc/sqlbase Explains how to apply server-specific options at various levels (API, connection, command, parameter, field) for SQLBase. ```APIDOC ## SQLBase Connection, Command, and Parameter Options ### Description This section describes how to configure SQLBase-specific options at different scopes within SQLAPI++: API, connection, command, parameter, and field levels. It details the available options and their default values. ### Option Scopes - **API Level**: Specified in `SAPI` object. - **Connection Level**: Specified in `SAPI` or `SAConnection` object. - **Command Level**: Specified in `SAPI`, `SAConnection`, or `SACommand` object. - **Parameter Level**: Specified in `SAPI`, `SAConnection`, `SACommand`, or `SAParam` object. - **Field Level**: Specified in `SAPI`, `SAConnection`, `SACommand`, or `SAField` object. ### SQLBASE Specific Options #### SQLBASE.LIBS - **Scope**: API Scope - **Description**: Forces SQLAPI++ to use specified SQLBase client library. - **Valid Values**: List of valid SQLBase client library names, separated by ';' (Windows) or ':' (other OS). - **Default Value**: Windows - `"sqlwntm.dll"`, Linux - `"libsqlbapl.so"` #### SQLPPCX - **Scope**: Command Scope - **Description**: Controls cursor-context preservation. Refer to SQLBase documentation for details. - **Valid Values**: `"off"`, `"on"` - **Default Value**: See SQLBase documentation. #### StoredObject - **Scope**: Command Scope - **Description**: Optimizes stored command execution when set to `"Command"`. - **Valid Values**: `"Procedure"`, `"Command"` - **Default Value**: `"Procedure"` #### UseDynamicCursor (Scrollable) - **Scope**: Command Scope - **Description**: Configures SQLAPI++ to use SQLBase scrollable result set mode. - **Valid Values**: `"True"`, `1` - **Default Value**: `"False"` #### SQLBaseUseDoubleForDecimal - **Scope**: Command Scope - **Description**: Configures SQLAPI++ to use `SA_dtDouble` type for SQLBase `DECIMAL(x,y)` data type. - **Valid Values**: `"True"`, `1` - **Default Value**: `"False"` ### Related Information - `SAOptions::setOption` ``` -------------------------------- ### Prepare() Source: https://www.sqlapi.com/ApiDoc/class_s_a_command Validates and prepares the current command for execution without actually executing it. It checks for syntax errors and verifies database object existence. ```APIDOC ## POST /websites/sqlapi_apidoc/prepare ### Description Validates and prepares the current command for execution. ### Method POST ### Endpoint /websites/sqlapi_apidoc/prepare ### Parameters None ### Request Example (No request body needed) ### Response #### Success Response (200) - **status** (string) - Indicates the command was prepared successfully. #### Response Example ```json { "status": "prepared" } ``` ``` -------------------------------- ### Connecting to SQL Server with OLEDB Source: https://www.sqlapi.com/ApiDoc/mssql_oledb Demonstrates how to set the 'UseAPI' option to OLEDB for SQL Server connections and establishes a connection using the SAConnection::Connect method. ```APIDOC ## POST /api/connect/sqlserver ### Description Establishes a connection to a SQL Server database using the SQLAPI++ library with the OLEDB provider. This involves initializing an `SAConnection` object, setting the 'UseAPI' option to 'OLEDB', and then calling the `Connect` method with the appropriate connection string, user ID, and password. ### Method POST ### Endpoint `/api/connect/sqlserver` ### Parameters #### Query Parameters - **serverName** (string) - Optional - The name or IP address of the SQL Server instance. - **databaseName** (string) - Optional - The name of the database to connect to. - **userId** (string) - Optional - The username for authentication. If omitted, a trusted connection is used. - **password** (string) - Optional - The password for authentication. - **driverConnectionOptions** (string) - Optional - A list of driver-specific connection options. #### Request Body ```json { "serverName": "MyServer\\SQLEXPRESS", "databaseName": "pubs", "userId": "sa", "password": "mypassword", "driverConnectionOptions": "Option1=Value1;Option2=Value2" } ``` ### Response #### Success Response (200) - **connectionId** (string) - A unique identifier for the established connection. #### Response Example ```json { "connectionId": "conn_12345abc" } ``` ### Error Handling - **400 Bad Request**: If required parameters are missing or invalid. - **401 Unauthorized**: If authentication fails. - **500 Internal Server Error**: If the OLEDB interface is not found or connection fails for other reasons. ``` -------------------------------- ### Getting Native MySQL Connection Handles Source: https://www.sqlapi.com/ApiDoc/mysql Retrieves native MySQL connection handles to allow direct calls to MySQL API functions not supported by SQLAPI++. ```APIDOC ## Getting Native MySQL Connection Handles ### Description This endpoint provides access to native MySQL connection handles, enabling the use of specific MySQL API functions that are not directly exposed by the SQLAPI++ library. These handles are necessary for advanced interactions with the MySQL server at a lower level. ### Method GET (Implied, as it's accessing an existing object's handles) ### Endpoint `con.NativeHandles()` (Conceptual, as it's a method call on a `SAConnection` object) ### Parameters None directly for the endpoint, but operates on an existing `SAConnection` object (`con`). ### Request Example ```cpp #include "myAPI.h" saConnectionHandles *pHandles = con.NativeHandles(); myConnectionHandles *pNativeHandles = (myConnectionHandles*)pHandles; // Use pNativeHandles for MySQL-specific API calls ``` ### Response #### Success Response - **pHandles** (`saConnectionHandles*`) - A pointer to the set of native API connection-related handles. #### Response Example ```cpp // The result of con.NativeHandles() is a pointer that needs to be cast // to the specific MySQL handle type (myConnectionHandles*). ``` ### Additional Information Refer to MySQL-specific documentation for details on the functions and handles available through `myConnectionHandles`. For more information on the `SAConnection::NativeHandles` method, see the SQLAPI++ documentation. ``` -------------------------------- ### Linker Options for SQLAPI++ Libraries (Command Line) Source: https://www.sqlapi.com/ApiDoc/build-app This shows command-line options for linking your application with SQLAPI++ libraries. The specific library file (`.lib` or `.a`) depends on the compiler, build type (release/debug), and whether you are using static or dynamic linking. ```bash For MSVC: /link %SQLAPIDIR%\lib\sqlapi.lib For GCC/Clang: -L${SQLAPIDIR}/lib -lsqlapi ``` -------------------------------- ### Getting Native InterBase / Firebird Command Related Handles Source: https://www.sqlapi.com/ApiDoc/ibase Retrieve native command-related handles for calling specific InterBase/Firebird API functions. ```APIDOC ## Getting Native InterBase / Firebird Command Related Handles ### Description This section explains how to obtain native API handles when you need to call specific InterBase/Firebird API functions not directly supported by the library. API functions typically require active handles as parameters. The `SACommand::NativeHandles` method returns a pointer to the set of native API command-related handles. You need to downcast the `saCommandHandles` pointer to the appropriate type to use its implementation-specific members. ### Usage To access native command handles, include the InterBase/Firebird-specific header and cast the result of `SACommand::NativeHandles` to the `ibCommandHandles` class. ### Code Example ```cpp #include "ibAPI.h" saCommandHandles *pHandles = cmd.NativeHandles(); ibCommandHandles *pNativeHandles = (ibCommandHandles*)pHandles; ``` ### Further Information Consult the InterBase/Firebird documentation for information on specific API functions and handles. For more information within SQLAPI++, refer to `SACommand::NativeHandles`. ``` -------------------------------- ### Using Native SQL Server (ODBC) API Source: https://www.sqlapi.com/ApiDoc/mssql_odbc Demonstrates how to use native SQL Server ODBC API functions through SQLAPI++. ```APIDOC ### Using Native SQL Server (ODBC) API You can call client-specific API functions not directly supported by the SQLAPI++ library. The `SAConnection::NativeAPI` method returns a pointer to the set of available native API functions for SQL Server. To use the database API directly, you must downcast this `IsaAPI` pointer to the appropriate type and use its implementation-specific members. **Note:** Using the correct type casting depends on the API, which generally requires explicitly checking the client version using the `SAConnection::ClientVersion` method. To use the native API, include the SQL Server (ODBC) specific header and cast the result of `SAConnection::NativeAPI` to the `ssNCliAPI` class: ```cpp #include "ssNcliAPI.h" IsaAPI *pApi = con.NativeAPI(); ssNCliAPI *pNativeAPI = (ssNCliAPI *)pApi; ``` For more information about SQL Server API functions, refer to the SQL Server (ODBC) documentation. ### Related Information - `SAConnection::NativeAPI` ``` -------------------------------- ### Getting Native InterBase / Firebird Connection Related Handles Source: https://www.sqlapi.com/ApiDoc/ibase Retrieve native connection-related handles for calling specific InterBase/Firebird API functions. ```APIDOC ## Getting Native InterBase / Firebird Connection Related Handles ### Description This section covers how to obtain native API handles when you need to call specific InterBase/Firebird API functions not directly exposed by SQLAPI++. API functions often require active handles as parameters. The `SAConnection::NativeHandles` method returns a pointer to the set of native API connection-related handles. You must downcast the `saConnectionHandles` pointer to the appropriate type to access its members. ### Usage To access native connection handles, include the InterBase/Firebird-specific header and cast the result of `SAConnection::NativeHandles` to the `ibConnectionHandles` class. ### Code Example ```cpp #include "ibAPI.h" saConnectionHandles *pHandles = con.NativeHandles(); ibConnectionHandles *pNativeHandles = (ibConnectionHandles*)pHandles; ``` ### Further Information Refer to the InterBase/Firebird documentation for details on specific API functions and handles. For more information within SQLAPI++, refer to `SAConnection::NativeHandles`. ``` -------------------------------- ### Get Native MySQL Command Handles (C++) Source: https://www.sqlapi.com/ApiDoc/mysql Retrieves native MySQL command handles using SACommand::NativeHandles. Requires including 'myAPI.h' and casting the result to 'myCommandHandles' for implementation-specific access. ```cpp #include "myAPI.h" saCommandHandles *pHandles = cmd.NativeHandles(); myCommandHandles *pNativeHandles = (myCommandHandles*)pHandles; ``` -------------------------------- ### Using Native SQLBase API Source: https://www.sqlapi.com/ApiDoc/sqlbase Instructions on how to access and utilize native SQLBase API functions not directly exposed by SQLAPI++. ```APIDOC ## Using Native SQLBase API ### Description This section explains how to use SQLBase API functions that are not directly supported by the SQLAPI++ library. It involves obtaining a pointer to the native API and casting it to the appropriate SQLBase type. ### Method 1. Call `SAConnection::NativeAPI()` to get an `IsaAPI*` pointer. 2. Cast the `IsaAPI*` pointer to a `sbAPI*` type. 3. Include the necessary SQLBase-specific header file (`sbAPI.h`). ### Example ```cpp #include "sbAPI.h" // Assuming 'con' is an initialized SAConnection object IsaAPI *pApi = con.NativeAPI(); sbAPI *pNativeAPI = (sbAPI *)pApi; ``` ### Important Considerations - Ensure correct API type casting based on the client version by checking `SAConnection::ClientVersion()`. - Refer to the official SQLBase documentation for details on available native API functions. ### Related Information - `SAConnection::NativeAPI` - `SAConnection::ClientVersion` ``` -------------------------------- ### Get Native MySQL Connection Handles (C++) Source: https://www.sqlapi.com/ApiDoc/mysql Retrieves native MySQL connection handles using SAConnection::NativeHandles. Requires including 'myAPI.h' and casting the result to 'myConnectionHandles' for implementation-specific access. ```cpp #include "myAPI.h" saConnectionHandles *pHandles = con.NativeHandles(); myConnectionHandles *pNativeHandles = (myConnectionHandles*)pHandles; ``` -------------------------------- ### Connecting to PostgreSQL Source: https://www.sqlapi.com/ApiDoc/pgsql Establishes a connection to a PostgreSQL database using the SAConnection::Connect method. The connection string format and authentication details are specified. ```APIDOC ## POST /websites/sqlapi_apidoc/postgresql/connect ### Description Establishes a connection to a PostgreSQL database using the SAConnection::Connect method. The connection string format and authentication details are specified. ### Method POST ### Endpoint /websites/sqlapi_apidoc/postgresql/connect ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **sDBString** (SAString) - Required - Connection string in the format '[@][][;]'. - **sUserID** (SAString) - Required - User name for authentication. - **sPassword** (SAString) - Required - Password for authentication. - **eSAClient** (SAClient_t) - Optional - Specifies the client type, defaults to SA_Client_NotSpecified for PostgreSQL. ### Request Example ```json { "sDBString": "my_server@my_database", "sUserID": "user", "sPassword": "password", "eSAClient": "SA_PostgreSQL_Client" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates successful connection. #### Response Example ```json { "status": "Connected successfully" } ``` ``` -------------------------------- ### Getting Native cubeSQL Command Handles Source: https://www.sqlapi.com/ApiDoc/cubesql This section explains how to retrieve native API handles for cubeSQL commands, which is necessary for invoking cubeSQL-specific API functions not covered by the standard SQLAPI++ library. ```APIDOC ## Getting Native cubeSQL Command Handles ### Description Utilize native API handles to invoke specific cubeSQL API functions that are not directly available through the SQLAPI++ library. These handles are often prerequisites for calling API functions. The `SACommand::NativeHandles` method returns a pointer to the set of native API command-related handles. ### Method `SACommand::NativeHandles()` ### Endpoint N/A (Method call within an existing command object) ### Parameters None ### Request Example ```cpp #include "cubeSqlAPI.h" saCommandHandles *pHandles = cmd.NativeHandles(); cubeSqlCommandHandles *pNativeHandles = (cubeSqlCommandHandles*)pHandles; ``` ### Response #### Success Response (Pointer to Native Handles) - `saCommandHandles*`: A pointer to the native API command handles. #### Response Example (See Request Example for code demonstrating the cast and usage) ### Additional Information Consult the cubeSQL specific documentation for comprehensive information on API functions and handles. Refer also to `SACommand::NativeHandles` documentation. ``` -------------------------------- ### Compiler Include Path for SQLAPI++ Headers (Command Line) Source: https://www.sqlapi.com/ApiDoc/build-app This demonstrates the typical command-line compiler options for specifying the include directory for SQLAPI++ header files. Replace '%SQLAPIDIR%' or '${SQLAPIDIR}' with the actual path to your SQLAPI++ installation. ```bash For MSVC: /I%SQLAPIDIR%\include For GCC/Clang: -I${SQLAPIDIR}/include ``` -------------------------------- ### Getting Native cubeSQL Connection Handles Source: https://www.sqlapi.com/ApiDoc/cubesql This section details how to obtain native API handles for cubeSQL connections when needing to call specific cubeSQL API functions not directly exposed by SQLAPI++. ```APIDOC ## Getting Native cubeSQL Connection Handles ### Description Use native API handles to call specific cubeSQL API functions not directly supported by the library. These handles are typically required as parameters for API functions. The `SAConnection::NativeHandles` method returns a pointer to the set of native API connection-related handles. ### Method `SAConnection::NativeHandles()` ### Endpoint N/A (Method call within an existing connection object) ### Parameters None ### Request Example ```cpp #include "cubeSqlAPI.h" saConnectionHandles *pHandles = con.NativeHandles(); cubeSqlConnectionHandles *pNativeHandles = (cubeSqlConnectionHandles*)pHandles; ``` ### Response #### Success Response (Pointer to Native Handles) - `saConnectionHandles*`: A pointer to the native API connection handles. #### Response Example (See Request Example for code demonstrating the cast and usage) ### Additional Information Refer to cubeSQL specific documentation for details on API functions and handles. Also see `SAConnection::NativeHandles` documentation. ``` -------------------------------- ### Using Native SQLite API Source: https://www.sqlapi.com/ApiDoc/sqlite Demonstrates how to access and use native SQLite API functions through SQLAPI++. ```APIDOC ## Using Native SQLite API ### Description Allows calling client-specific API functions not directly supported by SQLAPI++. This involves retrieving a pointer to the native API set and casting it to the appropriate type. ### Method `SAConnection::NativeAPI()` ### Endpoint N/A (Method Call) ### Parameters #### Method Parameters None ### Request Example ```cpp #include "sl3API.h" // Assuming 'con' is an initialized SAConnection object IsaAPI *pApi = con.NativeAPI(); sl3API *pNativeAPI = (sl3API *)pApi; // Now you can use pNativeAPI to call SQLite functions // For example: // pNativeAPI->some_sqlite_function(...); ``` ### Response #### Success Response (Pointer) - **IsaAPI*** - A pointer to the native API interface. #### Response Example See Request Example for usage. ``` -------------------------------- ### Connecting to a SQLBase Database Source: https://www.sqlapi.com/ApiDoc/sqlbase Establishes a connection to a SQLBase database using the SAConnection class and its Connect method. Requires database string, user ID, and password. ```APIDOC ## POST /api/connect/sqlbase ### Description Establishes a connection to a SQLBase database using the SAConnection class and its Connect method. This method requires the database name, user ID, and password for authentication. An optional client type can also be specified. ### Method POST ### Endpoint `/api/connect/sqlbase` ### Parameters #### Query Parameters - **sDBString** (string) - Required - The database name as it is specified in SQL.INI file. - **sUserID** (string) - Required - A string containing a user name to use when establishing the connection. - **sPassword** (string) - Required - A string containing a password to use when establishing the connection. - **eSAClient** (enum: SA_SQLBase_Client, SA_Client_NotSpecified) - Optional - Specifies the client type for the connection. Defaults to `SA_Client_NotSpecified`. ### Request Body ```json { "sDBString": "your_db_name", "sUserID": "your_username", "sPassword": "your_password", "eSAClient": "SA_SQLBase_Client" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the connection. - **message** (string) - A confirmation message of the connection. #### Response Example ```json { "status": "success", "message": "Successfully connected to SQLBase database." } ``` ``` -------------------------------- ### Get Native SQLite Command Handles (C++) Source: https://www.sqlapi.com/ApiDoc/sqlite Retrieves native command handles for direct interaction with SQLite API functions not exposed by SQLAPI++. Requires including 'sl3API.h' and casting the result to 'sl3CommandHandles'. ```cpp #include "sl3API.h" saCommandHandles *pHandles = cmd.NativeHandles(); sl3CommandHandles *pNativeHandles = (sl3CommandHandles*)pHandles; ``` -------------------------------- ### Get Native SQLite Connection Handles (C++) Source: https://www.sqlapi.com/ApiDoc/sqlite Retrieves native connection handles for direct interaction with SQLite API functions not exposed by SQLAPI++. Requires including 'sl3API.h' and casting the result to 'sl3ConnectionHandles'. ```cpp #include "sl3API.h" saConnectionHandles *pHandles = con.NativeHandles(); sl3ConnectionHandles *pNativeHandles = (sl3ConnectionHandles*)pHandles; ``` -------------------------------- ### Execute() Source: https://www.sqlapi.com/ApiDoc/class_s_a_command Executes the current command. This method implicitly calls Prepare() if needed and handles input/output parameters and result sets. ```APIDOC ## POST /websites/sqlapi_apidoc/execute ### Description Executes the current command. ### Method POST ### Endpoint /websites/sqlapi_apidoc/execute ### Parameters #### Request Body - **commandText** (string) - Required - The SQL command or stored procedure to execute. - **parameters** (object) - Optional - An object containing input parameters to bind. ### Request Example ```json { "commandText": "SELECT * FROM users WHERE id = ?", "parameters": { "id": 123 } } ``` ### Response #### Success Response (200) - **resultSetExists** (boolean) - True if a result set exists, false otherwise. - **rowsAffected** (integer) - The number of rows affected by the operation. - **outputParameters** (object) - An object containing output parameter values. #### Response Example ```json { "resultSetExists": true, "rowsAffected": 1, "outputParameters": { "outParamName": "outputValue" } } ``` ``` -------------------------------- ### Get Native Informix Command Handles (C++) Source: https://www.sqlapi.com/ApiDoc/informix Retrieves native Informix command handles for direct use with Informix API functions. This involves including 'infAPI.h' and casting the SACommandHandles pointer to 'infCommandHandles'. ```c++ #include "infAPI.h" saCommandHandles *pHandles = cmd.NativeHandles(); infCommandHandles *pNativeHandles = (infCommandHandles*)pHandles; ``` -------------------------------- ### Getting Native DB2 Connection Handles Source: https://www.sqlapi.com/ApiDoc/db2 This section describes how to obtain native DB2 connection-related handles using `SAConnection::NativeHandles()`. These handles are necessary for specific DB2 API functions that require them as parameters. ```APIDOC ## GET /websites/sqlapi_apidoc/native-db2-connection-handles ### Description Retrieves native DB2 connection handles via `SAConnection::NativeHandles()`. These handles are essential for calling specific DB2 API functions that require connection-related parameters. The returned `saConnectionHandles` pointer must be cast to `db2ConnectionHandles`. ### Method GET ### Endpoint `/websites/sqlapi_apidoc/native-db2-connection-handles` ### Parameters #### Query Parameters - **con** (object) - Required - The `SAConnection` object for which to get native handles. ### Response #### Success Response (200) - **handles** (object) - A pointer to the native DB2 connection handles, cast to `db2ConnectionHandles`. #### Response Example ```json { "handles": "" } ``` ``` -------------------------------- ### SAOptions Default Constructor and Option Management (C++) Source: https://www.sqlapi.com/ApiDoc/class_s_a_options Demonstrates the default constructor for the SAOptions class and methods for setting and retrieving string-based options. It highlights how to manage server-specific API, connection, command, parameter, or field options. Options not explicitly set will use default values. ```cpp SAOptions options; SAString connectionString = "..."; options.setOption("Connection", connectionString); SAString retrievedOption = options.Option("Connection"); int total = options.TotalOptions(); SAString optionName = options.OptionName(0); ``` -------------------------------- ### Get Native ODBC Command Handles with SQLAPI++ Source: https://www.sqlapi.com/ApiDoc/odbc Illustrates retrieving and casting native command handles using SACommand::NativeHandles() to the odbcCommandHandles type for direct interaction with ODBC API. Requires including 'odbcAPI.h'. ```cpp #include "odbcAPI.h" saCommandHandles *pHandles = cmd.NativeHandles(); odbcCommandHandles *pNativeHandles = (odbcCommandHandles*)pHandles; ``` -------------------------------- ### Connection, Command, Parameter, and Field Options Source: https://www.sqlapi.com/ApiDoc/informix Understand how to apply server-specific options at different levels (API, connection, command, parameter, field) for Informix. This section details options like `INFCLI.LIBS`, `UseIDSISAMERRMSG`, `PreFetchRows`, `UseDynamicCursor`, `SetCursorName`, `ExecDirect`, and `SQL_ATTR_QUERY_TIMEOUT`. ```APIDOC ## Informix Specific Options ### Description Applies server-specific options at API, connection, command, parameter, or field levels for Informix databases. ### Method `SAOptions::setOption()` or through connection/command objects. ### Endpoint N/A (Configuration options) ### Parameters #### API Level Options (SAPI object) - **INFCLI.LIBS** (string) - Required - Forces SQLAPI++ to use a specified Informix-CLI library. Separated by ';' on Windows or ':' on other OS. Special value: `"STATIC"`. #### Connection Level Options (SAPI object or SAConnection object) - **UseIDSISAMERRMSG** (boolean) - Optional - Forces SQLAPI++ to use `SQL_INFX_ATTR_IDSISAMERRMSG` connection attribute for richer error messages. Valid values: `"True"`, `"1"`. Default: `"False"`. #### Command Level Options (SAPI object, SAConnection object, or SACommand object) - **PreFetchRows** (string) - Optional - Fetches rows in bulk. Value is the number of rows in the fetch buffer. Default: `"1"`. - **UseDynamicCursor** (boolean) - Optional - Forces a scrollable dynamic command handle. Valid values: `"True"`, `"1"`. Default: `"False"`. - **SetCursorName** (string) - Optional - Allows defining the cursor name for the server-side cursor. See `SQLSetCursorName` documentation for valid values. Default: none. - **ExecDirect** (boolean) - Optional - Forces the use of `SQLExecDirect` instead of `SQLExecute`. Valid values: `"True"`, `"1"`. Default: `"False"`. - **SQL_ATTR_QUERY_TIMEOUT** (string) - Optional - Sets the timeout in seconds for SQL statement execution. Value is a string representing an integer. Default: none. ### Request Example ```cpp // Setting API level option SAAPI api; api.setOption("INFCLI.LIBS", "libifcli.so"); // Setting connection level option SAConnection con; con.setOption("UseIDSISAMERRMSG", "True"); // Setting command level option SACommand cmd; cmd.setOption("PreFetchRows", "50"); ``` ### Response Options are applied internally by the library. ### Success Response N/A ### Response Example N/A ``` -------------------------------- ### Getting Native Informix Command Handles Source: https://www.sqlapi.com/ApiDoc/informix Retrieve native Informix command handles to execute specific Informix API functions not directly supported by the library. This requires casting the result of `SACommand::NativeHandles()` to `infCommandHandles`. ```APIDOC ## Getting Native Informix Command Handles ### Description Use native API handles when you need to call specific Informix API functions that are not directly supported by the SQLAPI++ library. The `SACommand::NativeHandles` method returns a pointer to the set of native API command-related handles. ### Method `SACommand::NativeHandles()` ### Endpoint N/A (This is a library method, not an HTTP endpoint) ### Parameters None directly for the `NativeHandles` method itself. The usage involves casting the returned pointer. ### Request Example ```cpp #include "infAPI.h" saCommandHandles *pHandles = cmd.NativeHandles(); infCommandHandles *pNativeHandles = (infCommandHandles*)pHandles; // Use pNativeHandles for Informix-specific API functions ``` ### Response #### Success Response - **pHandles** (`saCommandHandles*`) - Pointer to the set of native API command-related handles. #### Response Example (See Request Example for how the pointer is cast and used) ### Notes - You need to include `infAPI.h` to use `infCommandHandles`. - Downcast the `saCommandHandles` pointer to `infCommandHandles` to access implementation-specific members. - Refer to Informix-specific documentation for details on API functions and handles. ``` -------------------------------- ### Getting Native Informix Connection Handles Source: https://www.sqlapi.com/ApiDoc/informix Retrieve native Informix connection handles to call specific Informix API functions not directly supported by the library. This involves casting the result of `SAConnection::NativeHandles()` to `infConnectionHandles`. ```APIDOC ## Getting Native Informix Connection Handles ### Description Use native API handles when you need to call specific Informix API functions that are not directly supported by the SQLAPI++ library. The `SAConnection::NativeHandles` method returns a pointer to the set of native API connection-related handles. ### Method `SAConnection::NativeHandles()` ### Endpoint N/A (This is a library method, not an HTTP endpoint) ### Parameters None directly for the `NativeHandles` method itself. The usage involves casting the returned pointer. ### Request Example ```cpp #include "infAPI.h" saConnectionHandles *pHandles = con.NativeHandles(); infConnectionHandles *pNativeHandles = (infConnectionHandles*)pHandles; // Use pNativeHandles for Informix-specific API functions ``` ### Response #### Success Response - **pHandles** (`saConnectionHandles*`) - Pointer to the set of native API connection-related handles. #### Response Example (See Request Example for how the pointer is cast and used) ### Notes - You need to include `infAPI.h` to use `infConnectionHandles`. - Downcast the `saConnectionHandles` pointer to `infConnectionHandles` to access implementation-specific members. - Refer to Informix-specific documentation for details on API functions and handles. ``` -------------------------------- ### API Initialization Source: https://www.sqlapi.com/ApiDoc/_s_q_l_a_p_i_8h Function to initialize the API handle with a specified client type. ```APIDOC ## API Initialization ### `sqlapi_init` **Description**: Initializes the SAPI handle with the specified DBMS client type. **Method**: N/A (Function call) **Parameters**: #### Path Parameters - **api** (`SAPI *`) - Required - The API handle to initialize. - **type** (`SAClient_t`) - Required - The type of the DBMS client. - **err** (`SAException *`) - Required - The error handle. **Return Type**: `SAErrorClass_t` ```