Connection and statement attributes
The IBM® i Access ODBC specification defines several connection and statement attributes.
This ODBC specification is extended with several IBM i Access for Windows customized attributes, that are described in the following 2 tables.
Attribute | Get/Set | Description |
---|---|---|
1204 | both | An unsigned value that controls the cursor commit
behavior and cursor rollback behavior. Possible values:
|
1281 | both | Specifies the Client User ID string that is sent to the host database. This attribute is set after connected to a database. The maximum length is 255 characters. As an alternative, the CLIENTUSERID connection string keyword is used. |
1282 | both | Specifies the Work Station Name string that is sent to the host database. The maximum length is 255 characters. The attribute is set after connected to a database. As an alternative, the CLIENTWRKSTNNAME connection string keyword is used. |
1283 | both | Specifies the Application Name string using the ODBC driver. The maximum length for this attribute is 255 characters. This attribute is set after connected to a database. As an alternative, the CLIENTAPPLNAME connection string keyword is used. |
1284 | both | Specifies the Accounting ID string that is sent to the host database. The maximum length is 255 characters. This attribute is set after connected to the host database. As an alternative, the CLIENTACCTSTR connection string keyword is used. |
2100 | both | Can be used as an alternative to using the DFTPKGLIB connection string keyword This is a character string that specifies the default package library to be used. This should be set prior to preparing a statement on this connection. |
2101 | both | This is a character string that specifies the package name to be used. This should be set prior to preparing a statement on this connection. |
2103 | get | Returns an unsigned integer value which is the server CCSID value (job CCSID) that the ODBC connection is dealing with. By default, SQL statements will be sent to the host in this CCSID |
2104 | both | Can be used as an alternative to the Divide
by zero option of the DEBUG connection string keyword. This is an
unsigned value indicating whether or not dividing a value by zero
should return an error for data in a particular cell in the result
set. Possible values:
|
2106 | both | An alternative to using the COMPRESSION connection
string keyword. This is an unsigned integer value. Possible values:
|
2109 | set | An unsigned value specifying whether or not
to trim trailing spaces from data returned from CHAR fields. This
will make CHAR fields appear like VARCHAR fields as VARCHAR fields
are always trimmed of trailing spaces. Possible values:
|
2110 | get | Returns a character string containing information
about the prestart job that the ODBC connection is using. The information
is returned as a string with the following format:
|
2116 | set | A pointer to a buffer containing the IBM Enterprise Workload Manager™ (eWLM) correlator. Specifying this attribute allows you to tie your application with the eWLM support (Enterprise Workload Manager). |
2117 | both | Can be used as an alternative to the CONCURRENTACCESSRESOLUTION
connection string keyword. This is an unsigned integer value which
controls how conflicting row locks encountered in the transaction
should be handled. Note: This property only applies to read-only queries
with isolation level CS.
|
2140 | both | An unsigned integer value that specifies the amount of time (in seconds) that a distributed transaction waits before timing out. A value of 0 indicates to wait indefinitely for the transaction to finish. Setting this overrides any value that was set for the XATIMEOUT connection string keyword. The default value for this attribute is 0. |
2141 | both | An unsigned integer value that specifies the maximum amount of time (in seconds) that a distributed transaction waits on a lock request before timing out. A value of 0 indicates to use the default system settings. Setting this overrides any value that was set for the XALOCKTIMEOUT connection string keyword. The default value for this attribute is 0. |
2142 | both | An integer value that specifies the RMID to use for XA transaction work. This can be set at anytime. The RMID that is set must be unique for the process. If this value is set to 0 it indicates that any current XA transaction work has been completed for this connection. The default value for this attribute is 0. |
2143 | get | A character string that identifies the IBM i Access driver to call into for XA calls. This string is only valid if the 2142 connection attribute has been set. This string is set after the connection is established. The default value for this attribute is an empty-string. |
2145 | both | Can be used as an alternative
to the XMLDECLARATION connection string keyword. This is an unsigned
integer value that is used to indicate what type of XML declaration
should be included with XML columns returned in result sets. Here
are the values and the meanings:
|
2146 | both | Can be used as an alternative
to the XMLSTRIPWS connection string keyword. This is an unsigned integer
value that indicates how whitespace in serialized XML data should
be handled by DB2® when the data
is implicitly parsed without validation. indicates whether whitespace
should be included or stripped from with the following possible values:
|
2511 | both | Specifies the Program ID string that is sent to the host database. The maximum size is 255 characters. The attribute is set after connected to a database. As an alternative, the CLIENTPROGRAMID connection string keyword is used. |
Attribute | Get/Set | Description |
---|---|---|
1014 | get | Returns an unsigned integer value indicating how many result sets are available to be fetched. This is useful when a stored procedure has been called and an application wants to know how many result sets the stored procedure generated. |
2106 | both | Allows compression to be turned on an off at
the statement level. Possible values are:
|
2114 | get | Returns an unsigned integer value that indicates the offset into a SQL statement at which a SQL syntax error has occurred. This will be set when SQLExecute or SQLExecDirect returns an SQL_ERROR return code. |