sqlesetc API - Set client connection settings
Specifies connection settings for the application. Use the sqle_conn_setting data structure to specify the connection setting types and values.
Authorization
None
Required connection
None
API include file
sqlenv.hAPI and data structure syntax
SQL_API_RC SQL_API_FN
sqlesetc (
struct sqle_conn_setting * pConnectionSettings,
unsigned short NumSettings,
struct sqlca * pSqlca);
SQL_API_RC SQL_API_FN
sqlgsetc (
struct sqle_conn_setting * pConnectionSettings,
unsigned short NumSettings,
struct sqlca * pSqlca);sqlesetc API parameters
- pConnectionSettings
- Input. A pointer to the sqle_conn_setting structure, which specifies connection setting types and values. Allocate an array of NumSettings sqle_conn_setting structures. Set the type field of each element in this array to indicate the connection option to set. Set the value field to the required value for the option.
- NumSettings
- Input. Any integer (from 0 to 7) representing the number of connection option values to set.
- pSqlca
- Output. A pointer to the sqlca structure.
Usage notes
If this API is successful, the connections in the subsequent units of work will use the connection settings specified. If this API is unsuccessful, the connection settings are unchanged.
The connection settings for the application can only be changed when there are no existing connections (for example, before any connection is established, or after RELEASE ALL and COMMIT).
Once the SET CLIENT API has executed successfully, the connection settings are fixed and can only be changed by again executing the SET CLIENT API. All corresponding precompiled options of the application modules will be overridden.
REXX API syntax
SET CLIENT USING :valuesREXX API parameters
- values
- A compound REXX host variable containing the connection settings
for the application process. In the following, XXX represents the host variable name.
- XXX.0
- Number of connection settings to be established
- XXX.1
- Specifies how to set up the CONNECTION type. The valid values
are:
- 1
- Type 1 CONNECT
- 2
- Type 2 CONNECT
- XXX.2
- Specifies how to set up the SQLRULES according to:
- Whether type 2 CONNECTs are to be processed according to the Db2® rules or the Standard (STD) rules based on ISO/ANS SQL92.
- How an application specifies the format of LOB columns in the result set.
- Db2
-
- Permits the SQL CONNECT statement to switch the current connection to another established (dormant) connection.
- This default setting allows an application to specify whether LOB values or LOB locators are retrieved only during the first fetch request. Subsequent fetch requests must use the same format for the LOB columns.
- STD
-
- Permits the SQL CONNECT statement to establish a new connection only. The SQL SET CONNECTION statement must be used to switch to a dormant connection.
- The application can change between retrieving LOB values and LOB locators with each fetch request. This means that cursors with one or more LOB columns cannot be blocked, regardless of the BLOCKING bind option setting.
- XXX.3
- Specifies how to set up the scope of disconnection to databases
at commit. The valid values are:
- EXPLICIT
- Disconnect only those marked by the SQL RELEASE statement
- CONDITIONAL
- Disconnect only those that have no open WITH HOLD cursors
- AUTOMATIC
- Disconnect all connections
- XXX.4
- Specifies how to set up the coordination among multiple database
connections during commits or rollbacks. The valid values are:
- TWOPHASE
- Use Transaction Manager (TM) to coordinate two-phase commits. The SYNCPOINT option is ignored and is available only for backward compatibility.
- XXX.6
- Specifies when to execute the PREPARE statement. The valid values
are:
- NO
- The PREPARE statement will be executed at the time it is issued
- YES
- The PREPARE statement will not be executed until the corresponding OPEN, DESCRIBE, or EXECUTE statement is issued. However, the PREPARE INTO statement is not deferred
- ALL
- Same as YES, except that the PREPARE INTO statement is also deferred