TimesTen ODBC 3.5 Support
This section covers theses topics for TimesTen ODBC 3.5 support.
Using ODBC 3.5 With TimesTen
In accordance with the ODBC 3.5 specification, an ODBC 3.5 application calls SQLSetEnvAttr
to set SQL_ATTR_ODBC_VERSION
to SQL_OV_ODBC3
directly after calling SQLAllocHandle
.
For example:
RetCode = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &hEnv);
...
RetCode = SQLSetEnvAttr(hEnv, SQL_ATTR_ODBC_VERSION, (SQLPOINTER)SQL_OV_ODBC3, 0);
...
RetCode = SQLAllocHandle(SQL_HANDLE_DBC, hEnv, &hDbc);
...
RetCode = SQLDriverConnect(hDbc, winHandle, connStr, SQL_NTS,
outConnStr, outConnStrBufferLen,
&outConnStrLen, SQL_DRIVER_NOPROMPT);
...
Tip:
Because TimesTen Release 22.1 is a major release, you should recompile and relink existing ODBC applications. Also see ODBC API Incompatibilities With Previous Versions of TimesTen.
It is also advisable to link your applications dynamically rather than statically.
Client/Server Cross-Release Restrictions With ODBC 3.5
Previous TimesTen releases support cross-release client/server connections, where the client version could be either newer or older than the server version (such as a 22.1 client connecting to an 18.1 server, or an 18.1 client connecting to a 22.1 server).
Due to changes in ODBC 3.5 functionality, TimesTen clients of Release 18.1 or later cannot connect to an older TimesTen server when the client declares itself to be ODBC 3.x compliant by specifying SQL_ODBC_OV3
in a SQLSetEnvAttr
call (such as shown in the preceding section).
Note:
This limitation does not impact ODBC 2.5 applications.
ODBC 3.5 New and Replacement Function Support
There are new and replacement ODBC 3.5 functions supported by TimesTen.
Note:
TimesTen supports wide-character (W) function versions for applications not using a generic driver manager, as indicated in Table 10-1 and Table 10-11.
Table 10-1 Supported ODBC 3.5 New and Replacement Functions
Function | Notes |
---|---|
|
With applicable settings for |
|
Call returns "Driver not capable." |
|
Replaces the ODBC 2.5 function |
|
Replaces the ODBC 2.5 function See TimesTen Field Identifiers for ODBC 3.5 SQLColAttribute. |
|
No notes |
|
Replaces the ODBC 2.5 function |
|
TimesTen supports only the |
|
With applicable settings for |
|
Replaces the ODBC 2.5 function Support is added for the TimesTen driver manager (TTDM). See Attribute Support for ODBC 3.5 SQLSetConnectAttr and SQLGetConnectAttr. |
|
No notes |
|
No notes |
|
Replaces the ODBC 2.5 function Native error codes are TimesTen errors. You may receive generic errors such as, "Execution at Oracle failed. Oracle error code When using
|
|
Replaces the ODBC 2.5 function Native error codes are TimesTen errors. You may receive generic errors such as, "Execution at Oracle failed. Oracle error code When using
|
|
Support is added for the TimesTen driver manager (TTDM). |
|
|
|
Replaces the ODBC 2.5 function See Attribute Support for ODBC 3.5 SQLSetStmtAttr and SQLGetStmtAttr. |
|
Replaces the ODBC 2.5 function See Attribute Support for ODBC 3.5 SQLSetConnectAttr and SQLGetConnectAttr. |
|
No notes |
|
No notes |
|
Required for ODBC applications to set |
|
Replaces the ODBC 2.5 function See Attribute Support for ODBC 3.5 SQLSetStmtAttr and SQLGetStmtAttr. |
ODBC 3.5 Data Type Support Notes
TimesTen supports new ODBC 3.5 data types.
-
SQL_C_NUMERIC
-
SQL_C_TYPE_DATE
-
SQL_C_TYPE_TIME
-
SQL_C_TYPE_TIMESTAMP
TimesTen does not support these data types or has limited support:
-
SQL_GUID
: TimesTen does not support conversion of this type to a C type. -
SQL_INTERVAL_
xxxx
: TimesTen does not support conversion of interval types to C types. -
SQL_WCHAR
: TimesTen does not support conversion of this type to C numeric types.
Environment Attribute Support for ODBC 3.5
There are standard environment attributes supported by TimesTen in ODBC 3.5.
Table 10-2 Standard Environment Attributes (ODBC 3.5)
Attribute | Notes |
---|---|
|
Supported values |
|
Supported value |
Attribute Support for ODBC 3.5 SQLSetConnectAttr and SQLGetConnectAttr
There are support of standard attributes by TimesTen for the ODBC 3.5
SQLSetConnectAttr
and SQLGetConnectAttr
functions.
Also, there are TimesTen-specific connection attributes, which are supported in both ODBC
3.5 and ODBC 2.5.
Table 10-3 lists support of standard attributes by TimesTen for the ODBC 3.5 SQLSetConnectAttr
and SQLGetConnectAttr
functions. Table 10-4 lists TimesTen-specific connection attributes, which are supported in both ODBC 3.5 and ODBC 2.5. These functions enable you to set connection attributes after the initial connection or retrieve those settings.
Also see Attribute Support for ODBC 3.5 SQLSetStmtAttr and SQLGetStmtAttr. Those attributes can also be set using
SQLSetConnectAttr
, in which case the value serves as a default
for all statements on the connection.
Note:
-
An attribute setting through
SQLSetConnectAttr
orSQLSetStmtAttr
overrides the setting of the corresponding connection attribute (as applicable). -
The documentation here also applies to
SQLSetConnectAttrW
andSQLGetConnectAttrW
. - The TimesTen driver manager (TTDM) is supported through the
TT_TTDM_CONNECTION_TYPE
attribute, as described in Table 10-4.
Table 10-3 Standard Connection Attributes (ODBC 3.5)
Attribute | Notes |
---|---|
|
Supported setting |
|
Read-only (get); value is always |
|
Read-only (get). |
|
Supported setting 0; any other setting reverts to 0. |
|
Driver not capable. |
|
Supported setting |
Table 10-4 TimesTen Connection Attributes
Attribute | Notes |
---|---|
|
This is for client/server only and has the same functionality as the Also see Choose SQL and PL/SQL Timeout Values in Oracle TimesTen In-Memory Database Operations Guide. |
|
See Enabling
or Disabling Dynamic Load in Oracle TimesTen In-Memory Database Cache
Guide.
This has the same functionality as the
|
|
See Returning Errors for Dynamic Load in Oracle TimesTen In-Memory Database Cache
Guide. This has the same functionality as the
|
|
Read-only (get). This indicates whether the database is from a TimesTen instance enabled for TimesTen Scaleout. |
|
This has the same functionality as the |
|
This has the same functionality as the |
|
This has the same functionality as the |
|
Read-only (get). See Configuration of Automatic Client Failover. This indicates the
setting of the TimesTen connection attribute
|
|
Set to |
|
See ODBC Support for Automatic Client Failover. This attribute is client-only. If you attempt to
use it in TimesTen direct mode, |
|
For ODBC applications that use parallel replication and specify replication tracks, this has the same functionality as the |
|
For ODBC applications using TTDM, specifying this as the attribute returns a value indicating the type of connection represented by the
See the example below. |
This example shows the use of SQLGetConnectAttr
with the attribute TT_TTDM_CONNECTION_TYPE
for an application using TTDM. The connection type, as documented in the table immediately above, is returned in connType
.
SQLINTEGER connType = 0; rc = SQLGetConnectAttr(hdbc, TT_TTDM_CONNECTION_TYPE, &connType, SQL_IS_INTEGER, NULL);
Attribute Support for ODBC 3.5 SQLSetStmtAttr and SQLGetStmtAttr
There are standard attributes supported by TimesTen for the ODBC 3.5
SQLSetStmtAttr
and SQLGetStmtAttr
functions. Also,
there are TimesTen-specific statement attributes, which are supported in both ODBC 3.5 and
ODBC 2.5.
Table 10-5 lists standard attributes supported by TimesTen for the ODBC 3.5 SQLSetStmtAttr
and SQLGetStmtAttr
functions. Table 10-6 lists TimesTen-specific statement attributes, which are supported in both ODBC 3.5 and ODBC 2.5. These functions enable you to set or retrieve statement attribute settings.
To set an attribute default value for all statements associated with a connection, use SQLSetConnectAttr
.
Note:
-
An attribute setting through
SQLSetConnectAttr
orSQLSetStmtAttr
overrides the setting of the corresponding connection attribute (as applicable). -
TimesTen also supports the options listed in Option Support for ODBC 2.5 SQLSetStmtOption and SQLGetStmtOption.
Table 10-5 Standard Statement Attributes (ODBC 3.5)
Attribute | Notes |
---|---|
|
No notes |
|
No notes |
|
Supported setting |
|
Supported setting |
|
No notes |
|
Read-only (get). |
|
Read-only (get). |
|
Supported setting |
|
No notes |
|
No notes |
|
No notes |
|
No notes |
|
No notes |
|
No notes |
|
No notes |
|
No notes |
|
No notes |
|
No notes |
Table 10-6 TimesTen Statement Attributes
Attribute | Notes |
---|---|
|
In client/server, determines the maximum number of bytes in the result set buffer. See Configuring the Result Set Buffer Size in Client/Server Using ODBC. |
|
In client/server, determines the maximum number of rows in the result set buffer. See Configuring the Result Set Buffer Size in Client/Server Using ODBC. |
|
|
|
See Setting a Threshold Duration for SQL Statements. This is to specify a time threshold for SQL statements, in seconds, after which TimesTen writes a warning to the support log. |
|
Commands are not shared with any other connection. See PrivateCommands in Oracle TimesTen In-Memory Database Reference. |
|
Determines whether a specific prepared statement is passed through to Oracle Database by the cache passthrough feature. The value returned by Note: In TimesTen, this option is supported only with See Determining Passthrough Status. Also see Setting a Passthrough Level in Oracle TimesTen In-Memory Database Cache Guide. |
Attribute Support for ODBC 3.5 SQLGetEnvAttr
This section describes TimesTen environmental attributes for SQLGetEnvAttr
.
Table 10-7 lists TimesTen-specific environment attributes, which are supported in both ODBC 3.5 and ODBC 2.5. These attributes support the TimesTen driver manager (TTDM).
Table 10-7 TimesTen Environment Attributes
Attribute | Notes |
---|---|
|
For ODBC applications using TTDM, if you specify this as the attribute and pass a
pointer to a
See the example below. Note: The available capabilities depend on what is available in the TimesTen environment where the TTDM-based application is executing. |
|
For ODBC applications using TTDM, if you specify this as the attribute and pass a pointer to a See the example below. |
This example shows the use of SQLGetEnvAttr
with the attribute TT_TTDM_VERSION
for an application using TTDM.
SQLCHAR ttdmver[21]; rc = SQLGetEnvAttr(henv, TT_TTDM_VERSION, (SQLPOINTER)ttdmver, sizeof(ttdmver), NULL);
The value returned in ttdmver
indicates the TimesTen release of the TTDM library that the application is using.
The next example shows the use of SQLGetEnvAttr
with the attribute TT_TTDM_CAPABILITIES
for an application using TTDM.
SQLINTEGER ttdmcap = 0; rc = SQLGetEnvAttr(henv, TT_TTDM_CAPABILITIES, (SQLPOINTER)&ttdmcap, 0, NULL);
The value returned in ttdmcap
is a bitwise OR
of the constants documented in the table above, indicating what capabilities are currently available through TTDM. Then check what capabilities are supported:
... if ( ttdmcap & TT_TTDM_CLIENT ) printf("TTDM: Client driver functions are available\n"); if ( ttdmcap & TT_TTDM_DIRECT ) printf("TTDM: Direct driver functions are available\n"); if ( ttdmcap & TT_TTDM_XLA ) printf("TTDM: XLA functions are available\n"); if ( ttdmcap & TT_TTDM_ROUTING ) printf("TTDM: Routing API functions are available\n"); if ( ttdmcap & TT_TTDM_UTILITY ) printf("TTDM: Utility functions are available\n"); ...
TimesTen Field Identifiers for ODBC 3.5 SQLColAttribute
The SQLColAttribute
function returns descriptor information for a column in a result set.
Refer to ODBC API reference documentation for complete information about this function and standard column descriptors.
Note:
This replaces SQLColAttributes
(plural) in ODBC 2.5.
See Table 10-8.
Table 10-8 TimesTen Field Identifiers: SQLColAttribute (ODBC 3.5)
Descriptor | Comment/Description |
---|---|
|
Returns |
|
For character-type columns, this returns "BYTE" for columns with byte length semantics and "CHAR" for columns with character length semantics. For non-character columns, it returns "". The information is returned in the This information refers to whether data length is measured in bytes or characters. Length semantics in TimesTen are the same as in Oracle Database. See Length Semantics in Oracle Database Globalization Support Guide. |
Information Type Support for ODBC 3.5 SQLGetInfo
There is support in the TimesTen ODBC 3.5 implementation for standard and TimesTen-specific information types for the ODBC function SQLGetInfo
.
Table 10-9 documents TimesTen support for standard information types that were introduced or renamed in ODBC 3.0, noting the TimesTen-specific correct value or values returned.
Refer to the following location for standard information:
https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlgetinfo-function
Also see Information Type Support for ODBC 2.5 SQLGetInfo. Those information types are still supported by the TimesTen ODBC 3.5 driver (with some renamed, as noted).
Table 10-9 TimesTen Support for Standard Information Types: SQLGetInfo (ODBC 3.5)
Information Type | Notes and Correct Values Returned by TimesTen |
---|---|
|
0: Environment objects are allocated from heap. |
|
|
|
0: |
|
|
|
|
|
0: Batches of SQL statements not supported. |
|
0: Batches of SQL statements not supported. |
|
0: Catalog names as qualifiers not supported.
|
|
"N": Catalog names as qualifiers not supported. |
|
|
|
"data store"
|
|
0: Catalogs not supported.
|
|
Current value of the Note: Because TimesTen does not have a default character set, default collation for the default character is set is not applicable. |
|
0: |
|
0: |
|
0: |
|
0: |
|
0: |
|
0: |
|
0: |
|
0: |
|
0: |
|
0: |
|
0: |
|
To determine which clauses are supported:
To specify the ability to create temporary tables:
To specify the ability to create column constraints:
|
|
0: |
|
|
|
|
|
|
|
|
|
"Y": Parameters can be described. |
|
|
|
Pointer to driver descriptor handle. |
|
0: |
|
0: |
|
0: |
|
0: |
|
0: |
|
|
|
0: |
|
|
|
None: Dynamic cursors not supported. |
|
None: Dynamic cursors not supported. |
|
|
|
|
|
|
|
None: Views in the |
|
|
|
"N"
|
|
None: Keyset cursors not supported. |
|
None: Keyset cursors not supported. |
|
|
|
0: No specific limit to number of active concurrent statements in asynchronous mode. |
Alias |
0: No specific maximum length.
|
Alias |
0: Allocated from heap, no limit on concurrency.
|
Alias |
|
Alias |
|
|
"N" |
Alias |
|
|
|
|
|
|
|
|
"owner"
|
|
|
|
|
|
None: Datetime scalar functions not supported. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
None: Row value constructor expressions not supported. |
|
None: String scalar functions not supported. |
|
|
|
None: Driver does not conform to CLI standards. |
|
|
|
|
|
|
|
|
|
|
Table 10-10 describes TimesTen-specific information types.
Table 10-10 TimesTen Information Types: SQLGetInfo
Information Type | Data Type | Description |
---|---|---|
|
|
Returns 1 if the database is in invalid state, such as due to a system or application failure, or 0 if not. Note: Fatal errors, such as error 846 or 994, invalidate a TimesTen database, causing this item to be set to 1. |
|
|
Returns the name of the database character set. |
|
|
Returns the maximum size of a character in the database character set, in bytes. |
|
Bit mask |
Returns a bit mask indicating platform information. Bit 0 has the value 1 for a 64-bit platform. Bit 1 has the value 1 for big-endian, or the value 0 for little-endian. |
|
|
Returns 1 if replication is in a failed state, or 0 if not. See Subscriber Failures in Oracle TimesTen In-Memory Database Replication Guide. |
TimesTen SQL Keywords for ODBC 3.5
The list of TimesTen SQL keywords returned for SQL_KEYWORDS
in a SQLGetInfo
call is the same in TimesTen ODBC 3.5 support as in ODBC 2.5 support.
See TimesTen SQL Keywords for ODBC 2.5.
This is different from the list of TimesTen reserved words. See Reserved Words in Oracle TimesTen In-Memory Database SQL Reference.