10 TimesTen ODBC Support

TimesTen provides an ODBC 3.51 driver that also supports ODBC 2.5 for applications not using a driver manager, as follows:

  • For ODBC 3.5, TimesTen supports ODBC 3.51 core interface conformance.

  • For ODBC 2.5, TimesTen supports Extension Level 1, as well as Extension Level 2 features that are documented in this chapter.

This chapter covers the details of TimesTen ODBC support, discussing the following topics, including changes in TimesTen 18.1 that may necessitate code changes in ODBC applications used with previous versions of TimesTen:

You can also refer to the following additional resources.

Also see "TimesTen include files", for information about #include files for TimesTen extensions.

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, such as in this 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);
...

Important:

Because TimesTen 18.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 an 11.2.2 client connecting to an 11.2.1 server, or an 11.2.1 client connecting to an 11.2.2 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

This section lists ODBC 3.5 new and replacement functions supported by TimesTen.

Note:

The TimesTen ODBC driver supports wide-character (W) function versions for applications not using a driver manager, as indicated in Table 10-1 and Table 10-8.

Table 10-1 Supported ODBC 3.5 new and replacement functions

Function Notes

SQLAllocHandle

With applicable settings for HandleType, replaces ODBC 2.5 functions SQLAllocEnv, SQLAllocConnect, and SQLAllocStmt.

SQLBulkOperations

Call returns "Driver not capable."

SQLCloseCursor

Replaces the ODBC 2.5 function SQLFreeStmt when that function is used with the SQL_CLOSE option.

SQLColAttribute and SQLColAttributeW

Replaces the ODBC 2.5 function SQLColAttributes.

SQLCopyDesc

No notes

SQLEndTran

Replaces the ODBC 2.5 function SQLTransact.

SQLFetchScroll

TimesTen supports only the SQL_FETCH_NEXT option (forward scroll).

SQLFreeHandle

With applicable settings for HandleType, replaces ODBC 2.5 functions SQLFreeEnv, SQLFreeConnect, and SQLFreeStmt.

SQLGetConnectAttr and SQLGetConnectAttrW

Replaces the ODBC 2.5 function SQLGetConnectOption.

SQLGetDescField and SQLGetDescFieldW

No notes

SQLGetDescRec and SQLGetDescRecW

No notes

SQLGetDiagField and SQLGetDiagFieldW

Replaces the ODBC 2.5 function SQLError.

Native error codes are TimesTen errors. You may receive generic errors such as, "Execution at Oracle failed. Oracle error code nnn."

When using SQLGetDiagField or SQLGetDiagFieldW:

  • Use TT_MAX_MESSAGE_LENGTH instead of SQL_MAX_MESSAGE_LENGTH (which is a limit of 512 bytes).

  • Handle a possible return of SQL_SUCCESS_WITH_INFO (for example, in case the message length exceeded the input buffer size).

SQLGetDiagRec and SQLGetDiagRecW

Replaces the ODBC 2.5 function SQLError.

Native error codes are TimesTen errors. You may receive generic errors such as, "Execution at Oracle failed. Oracle error code nnn."

When using SQLGetDiagRec or SQLGetDiagRecW:

  • Use TT_MAX_MESSAGE_LENGTH instead of SQL_MAX_MESSAGE_LENGTH (which is a limit of 512 bytes).

  • Handle a possible return of SQL_SUCCESS_WITH_INFO (for example, in case the message length exceeded the input buffer size).

SQLGetEnvAttr

No notes

SQLGetStmtAttr and SQLGetStmtAttrW

Replaces the ODBC 2.5 function SQLGetStmtOption.

SQLSetConnectAttr and SQLSetConnectAttrW

Replaces the ODBC 2.5 function SQLSetConnectOption.

SQLSetDescField

No notes

SQLSetDescRec

No notes

SQLSetEnvAttr

Required for ODBC applications to set SQL_ATTR_ODBC_VERSION to SQL_OV_ODBC3.

SQLSetStmtAttr and SQLSetStmtAttrW

Replaces the ODBC 2.5 function SQLSetStmtOption.


ODBC 3.5 data type support notes

TimesTen supports these data types, new in ODBC 3.5:

  • 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

Table 10-2 lists standard environment attributes supported by TimesTen in ODBC 3.5.

Table 10-2 Standard environment attributes (ODBC 3.5)

Attribute Notes

SQL_ATTR_ODBC_VERSION

Supported values SQL_OV_ODBC3 and SQL_OV_ODBC2.

SQL_ATTR_OUTPUT_NTS

Supported value SQL_TRUE.


Attribute support for ODBC 3.5 SQLSetConnectAttr and SQLGetConnectAttr

Table 10-3 lists support of standard attributes by TimesTen for the ODBC 3.5 SQLSetConnectAttr and SQLGetConnectAttr functions. 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.

For TimesTen-specific attributes, see "Option support for ODBC 2.5 SQLSetConnectOption and SQLGetConnectOption". These attributes are supported for both ODBC 2.5 and ODBC 3.5.

Notes:

Table 10-3 Standard connection attributes (ODBC 3.5)

Attribute Notes

SQL_ATTR_ASYNC_ENABLE

Supported setting SQL_ASYNC_ENABLE_OFF.

SQL_ATTR_AUTO_IPD

Read-only (get); value is always SQL_TRUE.

SQL_ATTR_CONNECTION_DEAD

Read-only (get).

SQL_ATTR_CONNECTION_TIMEOUT

Supported setting 0; any other setting reverts to 0.

SQL_ATTR_ENLIST_IN_DTC

Driver not capable.

SQL_ATTR_METADATA_ID

Supported setting SQL_FALSE.


Attribute support for ODBC 3.5 SQLSetStmtAttr and SQLGetStmtAttr

Table 10-4 lists standard attributes supported by TimesTen for the ODBC 3.5 SQLSetStmtAttr and SQLGetStmtAttr functions. 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.

Notes:

Table 10-4 Standard statement attributes (ODBC 3.5)

Attribute Notes

SQL_ATTR_APP_PARAM_DESC

No notes

SQL_ATTR_APP_ROW_DESC

No notes

SQL_ATTR_CURSOR_SCROLLABLE

Supported setting SQL_NONSCROLLABLE.

SQL_ATTR_CURSOR_SENSITIVITY

Supported setting SQL_INSENSITIVE.

SQL_ATTR_ENABLE_AUTO_IPD

No notes

SQL_ATTR_IMP_PARAM_DESC

Read-only (get).

SQL_ATTR_IMP_ROW_DESC

Read-only (get).

SQL_ATTR_METADATA_ID

Supported setting SQL_FALSE.

SQL_ATTR_PARAM_BIND_OFFSET_PTR

No notes

SQL_ATTR_PARAM_BIND_TYPE

No notes

SQL_ATTR_PARAM_OPERATION_PTR

No notes

SQL_ATTR_PARAM_STATUS_PTR

No notes

SQL_ATTR_PARAMS_PROCESSED_PTR

No notes

SQL_ATTR_PARAMSET_SIZE

No notes

SQL_ATTR_ROW_ARRAY_SIZE

No notes

SQL_ATTR_ROW_BIND_OFFSET_PTR

No notes

SQL_ATTR_ROW_STATUS_PTR

No notes

SQL_ATTR_ROWS_FETCHED_PTR

No notes


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.

Table 10-5 describes TimesTen-specific field identifiers.

Table 10-5 TimesTen field identifiers: SQLColAttribute (ODBC 3.5)

Descriptor Comment/description

TT_COLUMN_INLINE

Returns TRUE for columns with inline data, or FALSE otherwise. This is returned in the SQLColAttribute CharacterAttributePtr parameter.

TT_COLUMN_LENGTH_SEMANTICS

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 SQLColAttribute CharacterAttributePtr parameter.

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 for additional information.


Information type support for ODBC 3.5 SQLGetInfo

This section covers support in the TimesTen ODBC 3.5 implementation for standard and TimesTen-specific information types for the ODBC function SQLGetInfo.

Table 10-6 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-6 TimesTen support for standard information types: SQLGetInfo (ODBC 3.5)

Information type Notes and correct values returned by TimesTen

SQL_ACTIVE_ENVIRONMENTS

0: Environment objects are allocated from heap.

SQL_AGGREGATE_FUNCTIONS

SQL_AF_ALL, SQL_AF_AVG, SQL_AF_COUNT, SQL_AF_DISTINCT, SQL_AF_MAX, SQL_AF_MIN, SQL_AF_SUM

SQL_ALTER_DOMAIN

0: ALTER DOMAIN statement not supported.

SQL_ALTER_TABLE

SQL_AT_ADD_COLUMN_DEFAULT: ADD COLUMN clause is supported, with facility to specify column defaults (FIPS transitional level).

SQL_AT_ADD_COLUMN_SINGLE: ADD COLUMN clause is supported (FIPS transitional level).

SQL_AT_ADD_CONSTRAINT: ADD COLUMN clause is supported, with facility to specify column constraints (FIPS transitional level).

SQL_AT_ADD_TABLE_CONSTRAINT: ADD TABLE CONSTRAINT clause is supported (FIPS transitional level).

SQL_AT_DROP_COLUMN_CASCADE: DROP COLUMN ... CASCADE clause is supported (FIPS transitional level).

SQL_AT_DROP_COLUMN_DEFAULT: ALTER COLUMN ... DROP COLUMN DEFAULT clause is supported (Intermediate level).

SQL_ASYNC_MODE

SQL_AM_NONE: Asynchronous mode not supported.

SQL_BATCH_ROW_COUNT

0: Batches of SQL statements not supported.

SQL_BATCH_SUPPORT

0: Batches of SQL statements not supported.

SQL_CATALOG_LOCATION

0: Catalog names as qualifiers not supported.

SQL_QUALIFIER_LOCATION in ODBC 2.5.

SQL_CATALOG_NAME

"N": Catalog names as qualifiers not supported.

SQL_CATALOG_NAME_SEPARATOR

NULL: Not supported.

SQL_QUALIFIER_NAME_SEPARATOR in ODBC 2.5.

SQL_CATALOG_TERM

"data store"

SQL_QUALIFIER_TERM in ODBC 2.5.

SQL_CATALOG_USAGE

0: Catalogs not supported.

SQL_QUALIFIER_USAGE in ODBC 2.5.

SQL_COLLATION_SEQ

Current value of the NLS_SORT database parameter.

Note: Because TimesTen does not have a default character set, default collation for the default character is set is not applicable. NLS_SORT is the collation for the current character set.

SQL_CONVERT_GUID

0: CONVERT function not supported.

SQL_CONVERT_INTERVAL_DAY_TIME

0: CONVERT function not supported.

SQL_CONVERT_INTERVAL_YEAR_MONTH

0: CONVERT function not supported.

SQL_CONVERT_WCHAR

0: CONVERT function not supported.

SQL_CONVERT_WLONGVARCHAR

0: CONVERT function not supported.

SQL_CONVERT_WVARCHAR

0: CONVERT function not supported.

SQL_CREATE_ASSERTION

0: CREATE ASSERTION statement not supported.

SQL_CREATE_CHARACTER_SET

0: CREATE CHARACTER SET statement not supported.

SQL_CREATE_COLLATION

0: CREATE COLLATION statement not supported.

SQL_CREATE_DOMAIN

0: CREATE DOMAIN statement not supported.

SQL_CREATE_SCHEMA

0: CREATE SCHEMA statement not supported.

SQL_CREATE_TABLE

To determine which clauses are supported:

SQL_CT_CREATE_TABLE: CREATE TABLE statement is supported (entry level).

SQL_CT_TABLE_CONSTRAINT: Specifying table constraints is supported (FIPS transitional level).

SQL_CT_CONSTRAINT_NAME_DEFINITION: <constraint name definition> clause is supported for naming column and table constraints (intermediate level).

To specify the ability to create temporary tables:

SQL_CT_COMMIT_PRESERVE: Deleted rows are preserved on commit (full level).

SQL_CT_COMMIT_DELETE: Deleted rows are deleted on commit (full level).

SQL_CT_GLOBAL_TEMPORARY: Global temporary tables can be created (full level).

To specify the ability to create column constraints:

SQL_CT_COLUMN_CONSTRAINT: Specifying column constraints is supported (FIPS transitional level).

SQL_CT_COLUMN_DEFAULT: Specifying column defaults is supported (FIPS transitional level).

SQL_CREATE_TRANSLATION

0: CREATE TRANSLATION statement not supported.

SQL_CREATE_VIEW

SQL_CV_CREATE_VIEWS

SQL_CURSOR_SENSITIVITY

SQL_SENSITIVE: Cursors are sensitive to changes made by other cursors within the same transaction.

SQL_DATETIME_LITERALS

SQL_DL_SQL92_DATE, SQL_DL_SQL92_TIME, SQL_DL_SQL92_TIMESTAMP

SQL_DDL_INDEX

SQL_DI_CREATE_INDEX, SQL_DI_DROP_INDEX

SQL_DESCRIBE_PARAMETER

"Y": Parameters can be described.

SQL_DM_VER

ERROR IM001: Driver does not support this function. Applies to driver manager only.

SQL_DRIVER_HDESC

Pointer to driver descriptor handle.

SQL_DROP_ASSERTION

0: DROP ASSERTION statement not supported.

SQL_DROP_CHARACTER_SET

0: DROP_CHARACTER_SET statement not supported.

SQL_DROP_COLLATION

0: DROP_COLLATION statement not supported.

SQL_DROP_DOMAIN

0: DROP_DOMAIN statement not supported.

SQL_DROP_SCHEMA

0: DROP_SCHEMA statement not supported.

SQL_DROP_TABLE

SQL_DT_DROP_TABLE

SQL_DROP_TRANSLATION

0: DROP_TRANSLATION statement not supported.

SQL_DROP_VIEW

SQL_DV_DROP_VIEW

SQL_DYNAMIC_CURSOR_ATTRIBUTES1

None: Dynamic cursors not supported.

SQL_DYNAMIC_CURSOR_ATTRIBUTES2

None: Dynamic cursors not supported.

SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1

SQL_CA1_NEXT, SQL_CA1_SELECT_FOR_UPDATE

SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2

SQL_CA2_READ_ONLY_CONCURRENCY, SQL_CA2_MAX_ROWS_SELECT

SQL_INDEX_KEYWORDS

SQL_IK_ALL: All keywords supported.

SQL_INFO_SCHEMA_VIEWS

None: Views in the INFORMATION_SCHEMA not supported.

SQL_INSERT_STATEMENT

SQL_IS_INSERT_LITERALS, SQL_IS_INSERT_SEARCHED, SQL_IS_SELECT_INTO

SQL_INTEGRITY

"N"

SQL_ODBC_SQL_OPT_IEF in ODBC 2.5.

SQL_KEYSET_CURSOR_ATTRIBUTES1

None: Keyset cursors not supported.

SQL_KEYSET_CURSOR_ATTRIBUTES2

None: Keyset cursors not supported.

SQL_KEYWORDS

TT_SQL_KEYWORDS: A character string that contains a comma-separated list of TimesTen-specific SQL keywords.

See "TimesTen SQL keywords for ODBC 3.5".

SQL_MAX_ASYNC_CONCURRENT_STATEMENTS

0: No specific limit to number of active concurrent statements in asynchronous mode.

SQL_MAX_CATALOG_NAME_LEN

Alias SQL_MAXIMUM_CATALOG_NAME_LENGTH

0: No specific maximum length.

SQL_MAX_QUALIFIER_NAME_LEN in ODBC 2.5.

SQL_MAX_CONCURRENT_ACTIVITIES

Alias SQL_MAXIMUM_CONCURRENT_ACTIVITIES

0: Allocated from heap, no limit on concurrency.

SQL_ACTIVE_STATEMENTS in ODBC 2.5.

SQL_MAX_DRIVER_CONNECTIONS

Alias SQL_MAXIMUM_DRIVER_CONNECTIONS

sb_DbConnMaxUser: Daemon connections limited to this value.

SQL_ACTIVE_CONNECTIONS in ODBC 2.5.

SQL_MAX_IDENTIFIER_LEN

Alias SQL_MAXIMUM_IDENTIFIER_LENGTH

sb_ObjNameLenMax

SQL_MAX_ROW_SIZE_INCLUDES_LONG

"N"

SQL_MAX_SCHEMA_NAME_LEN

Alias SQL_MAXIMUM_SCHEMA_NAME_LENGTH

sb_ObjNameLenMax

SQL_MAX_OWNER_NAME_LEN in ODBC 2.5.

SQL_ODBC_INTERFACE_CONFORMANCE

SQL_OIC_CORE: Minimum level, including basic interface elements such as connection functions, functions for preparing and executing an SQL statement, basic result set metadata functions, and basic catalog functions.

SQL_PARAM_ARRAY_ROW_COUNTS

SQL_PARC_NO_BATCH

SQL_PARAM_ARRAY_SELECTS

SQL_PAS_NO_SELECT

SQL_SCHEMA_TERM

"owner"

SQL_OWNER_TERM in ODBC 2.5.

SQL_SCHEMA_USAGE

SQL_OU_DML_STATEMENTS: Schemas supported in all DML statements.

SQL_OU_PROCEDURE_INVOCATION: Schemas supported in the ODBC procedure invocation statement.

SQL_OU_TABLE_DEFINITION: Schemas supported in CREATE TABLE, CREATE VIEW, ALTER TABLE, DROP TABLE, and DROP VIEW statements.

SQL_OU_INDEX_DEFINITION: Schemas supported in CREATE INDEX and DROP INDEX statements.

SQL_OU_PRIVILEGE_DEFINITION: Schemas are supported in GRANT and REVOKE statements.

SQL_OWNER_USAGE in ODBC 2.5.

SQL_SQL_CONFORMANCE

SQL_SC_SQL92_ENTRY: Entry level SQL-92 compliant.

SQL_SQL92_DATETIME_FUNCTIONS

None: Datetime scalar functions not supported.

SQL_SQL92_FOREIGN_KEY_DELETE_RULE

SQL_SFKD_CASCADE

SQL_SQL92_FOREIGN_KEY_UPDATE_RULE

SQL_SFKU_SET_DEFAULT, SQL_SFKU_SET_NULL

SQL_SQL92_GRANT

SQL_SG_DELETE_TABLE, SQL_SG_INSERT_TABLE, SQL_SG_REFERENCES_TABLE, SQL_SG_SELECT_TABLE, SQL_SG_UPDATE_TABLE (all entry level)

SQL_SQL92_NUMERIC_VALUE_FUNCTIONS

SQL_SNVF_EXTRACT

SQL_SQL92_PREDICATES

SQL_SP_BETWEEN, SQL_SP_COMPARISON, SQL_SP_EXISTS, SQL_SP_IN, SQL_SP_ISNOTNULL, SQL_SP_ISNULL, SQL_SP_LIKE (all entry level)

SQL_SQL92_RELATIONAL_JOIN_OPERATORS

SQL_SRJO_CROSS_JOIN (full level), SQL_SRJO_INNER_JOIN (FIPS transitional level), SQL_SRJO_LEFT_OUTER_JOIN (FIPS transitional level), SQL_SRJO_RIGHT_OUTER_JOIN (FIPS transitional level)

SQL_SQL92_REVOKE

SQL_SR_DELETE_TABLE, SQL_SR_INSERT_TABLE, SQL_SR_REFERENCES_TABLE, SQL_SR_SELECT_TABLE, SQL_SR_UPDATE_TABLE (all entry level)

SQL_SQL92_ROW_VALUE_CONSTRUCTOR

None: Row value constructor expressions not supported.

SQL_SQL92_STRING_FUNCTIONS

None: String scalar functions not supported.

SQL_SQL92_VALUE_EXPRESSIONS

SQL_SVE_CASE (intermediate level), SQL_SVE_CAST (FIPS transitional level), SQL_SVE_NULLIF (intermediate level)

SQL_STANDARD_CLI_CONFORMANCE

None: Driver does not conform to CLI standards.

SQL_STATIC_CURSOR_ATTRIBUTES1

SQL_CA1_NEXT, SQL_CA1_SELECT_FOR_UPDATE

SQL_STATIC_CURSOR_ATTRIBUTES2

SQL_CA2_READ_ONLY_CONCURRENCY, SQL_CA2_MAX_ROWS_SELECT

SQL_TIMEDATE_FUNCTIONS

SQL_FN_TD_EXTRACT, SQL_FN_TD_NOW, SQL_FN_TD_TIMESTAMPADD, SQL_FN_TD_TIMESTAMPDIFF

SQL_UNION_STATEMENT

SQL_U_UNION: Data source supports UNION clause.

SQL_U_UNION_ALL: Data source supports ALL keyword in the UNION clause. (SQLGetInfo returns both SQL_U_UNION and SQL_U_UNION_ALL in this case.)

SQL_UNION in ODBC 2.5.

SQL_XOPEN_CLI_YEAR

ERROR IM001: Driver does not support this function. Applies to driver manager only.


Table 10-7 describes TimesTen-specific information types.

Table 10-7 TimesTen information types: SQLGetInfo

Information type Data type Description

TT_DATA_STORE_INVALID

SQLINTEGER

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.

TT_DATABASE_CHARACTER_SET

SQLCHAR

Returns the name of the database character set.

TT_DATABASE_CHARACTER_SET_SIZE

SQLINTEGER

Returns the maximum size of a character in the database character set, in bytes.

TT_PLATFORM_INFO

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.

TT_REPLICATION_INVALID

SQLINTEGER

Returns 1 if replication is in a failed state, or 0 if not.

For additional information, 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. For that list, see "Reserved Words" in Oracle TimesTen In-Memory Database SQL Reference.

TimesTen ODBC 2.5 support

This section covers these topics for TimesTen 2.5 support:

Using ODBC 2.5 with TimesTen

An ODBC 2.5 application not using a driver manager will continue to work with the TimesTen 18.1 ODBC driver through its call to SQLAllocEnv.

Important:

Because TimesTen 18.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.

ODBC 2.5 function support

This section lists ODBC 2.5 functions supported by TimesTen.

Notes:

  • The TimesTen ODBC driver supports wide-character (W) function versions for applications not using a driver manager, as indicated in Table 10-8.

  • In ODBC 2.5, TimesTen supports some ODBC 3.0 handle types (such as SQLHDBC and SQLHENV) as well as ODBC 2.0 handle types (such as HDBC and HENV). TimesTen recommends using ODBC 3.0 handle types. The FAR modifier that is mentioned in ODBC 2.0 documentation is not required.

Table 10-8 Supported ODBC 2.5 functions

Function Notes

SQLAllocConnect

No notes

SQLAllocEnv

No notes

SQLAllocStmt

No notes

SQLBindCol

No notes

SQLBindParameter

See "SQLBindParameter function".

SQLCancel

SQLCancel can cancel the following:

  • An operation running on an hstmt on another thread

  • An operation running on an hstmt that needs data

SQLCancel cannot cancel the following:

  • TimesTen Cache administrative operations

Do not call SQLCancel directly from a signal handler. Such code may not be portable.

SQLColAttributes and SQLColAttributesW

See "Column descriptor support for ODBC 2.5 SQLColAttributes".

Also see "ODBC 2.5 function signatures that have changed".

SQLColumnPrivileges

Call returns "driver not capable".

SQLColumns and SQLColumnsW

For catalog functions, TimesTen supports only an empty string or NULL as the qualifier.

SQLConnect and ttSQLConnectW

Note the TimesTen name for the "W" function.

SQLDataSources and SQLDataSourcesW

Available only to programs using a driver manager.

SQLDescribeCol and SQLDescribeColW

No notes

SQLDescribeParam

No notes

SQLDisconnect

No notes

SQLDriverConnect and SQLDriverConnectW

No notes

SQLDrivers and SQLDriversW

Available only to programs using a driver manager.

SQLError and SQLErrorW

Native error codes are TimesTen errors. You may receive generic errors such as, "Execution at Oracle failed. Oracle error code nnn."

When using SQLError or SQLErrorW:

  • Use TT_MAX_MESSAGE_LENGTH (which is a higher limit) instead of SQL_MAX_MESSAGE_LENGTH (which is a limit of 512 bytes).

  • Handle a possible return of SQL_SUCCESS_WITH_INFO (for example, in case the message length exceeded the input buffer size).

SQLExecDirect

See SQLExecute.

SQLExecute

TimesTen does not support asynchronous statement execution. (TimesTen does not support the SQL_ASYNC_ENABLE statement option, as noted later in this chapter.)

SQLFetch

The return code is defined as SQL_NO_DATA_FOUND when no more rows are returned.

SQL_NO_DATA_FOUND is defined in sqlext.h, which is included by timesten.h.

SQLForeignKeys and SQLForeignKeysW

For catalog functions, TimesTen supports only an empty string or NULL as the qualifier.

SQLFreeConnect

No notes

SQLFreeEnv

No notes

SQLFreeStmt

No notes

SQLGetConnectOption and SQLGetConnectOptionW

See "Option support for ODBC 2.5 SQLSetConnectOption and SQLGetConnectOption".

Also see "ODBC 2.5 function signatures that have changed".

SQLGetCursorName and SQLGetCursorNameW

You can set or get a cursor name but not reference it, such as in a WHERE CURRENT OF clause for a positioned update or delete. TimesTen does not support positioned update or delete statements.

SQLGetData

See "Avoid SQLGetData".

SQLGetFunctions

No notes

SQLGetInfo and SQLGetInfoW

See "Information type support for ODBC 2.5 SQLGetInfo".

Also see "ODBC 2.5 function signatures that have changed".

SQLGetStmtOption

See "Option support for ODBC 2.5 SQLSetStmtOption and SQLGetStmtOption".

Also see "ODBC 2.5 function signatures that have changed".

SQLGetTypeInfo and SQLGetTypeInfoW

For catalog functions, TimesTen supports only an empty string or NULL as the qualifier.

SQLNativeSql and SQLNativeSqlW

No notes

SQLNumParams

No notes

SQLNumResultCols

No notes

SQLParamData

No notes

SQLParamOptions

See "ODBC 2.5 function signatures that have changed".

SQLPrepare and SQLPrepareW

No notes

SQLPrimaryKeys and SQLPrimaryKeysW

For catalog functions, TimesTen supports only an empty string or NULL as the qualifier.

SQLProcedureColumns and SQLProcedureColumnsW

For catalog functions, TimesTen supports only an empty string or NULL as the qualifier.

SQLProcedures and SQLProceduresW

For catalog functions, TimesTen supports only an empty string or NULL as the qualifier.

SQLPutData

No notes

SQLRowCount

In addition to its standard functionality, this is used with TimesTen cache groups. See "Managing cache groups".

SQLSetConnectOption and SQLSetConnectOptionW

See "Option support for ODBC 2.5 SQLSetConnectOption and SQLGetConnectOption" under the next section.

Also see "ODBC 2.5 function signatures that have changed".

SQLSetCursorName and SQLSetCursorNameW

You can set or get a cursor name but not reference it, such as in a WHERE CURRENT OF clause for a positioned update or delete.

SQLSetParam

This is an ODBC 1.0 function, replaced by SQLBindParameter in ODBC 2.0. Retained for backward compatibility.

SQLSetPos

Call returns "driver not capable".

SQLSetStmtOption

See "Option support for ODBC 2.5 SQLSetStmtOption and SQLGetStmtOption".

Also see "ODBC 2.5 function signatures that have changed".

SQLSpecialColumns and SQLSpecialColumnsW

TimesTen supports only the SQL_BEST_ROWID option.

For catalog functions, TimesTen supports only an empty string or NULL as the qualifier.

SQLStatistics and SQLStatisticsW

For catalog functions, TimesTen supports only an empty string or NULL as the qualifier.

SQLTablePrivileges

Call returns "driver not capable".

SQLTables and SQLTablesW

For catalog functions, TimesTen supports only an empty string or NULL as the qualifier.

SQLTransact

No notes


Option support for ODBC 2.5 SQLSetConnectOption and SQLGetConnectOption

Table 10-9 lists standard options supported by TimesTen for the ODBC 2.5 SQLSetConnectOption and SQLGetConnectOption functions, with notes about the support. Table 10-10 lists TimesTen-specific options. These functions enable you to set connection options after the initial connection or retrieve those settings. Some of these correspond to connection attributes you can set during the connection process, as noted.

Also see "Option support for ODBC 2.5 SQLSetStmtOption and SQLGetStmtOption". Those options can also be set using SQLSetConnectOption, in which case the value serves as a default for all statements on the connection.

Notes:

  • An option setting through SQLSetConnectOption or SQLSetStmtOption overrides the setting of the corresponding connection attribute (as applicable).

  • The documentation here also applies to SQLSetConnectOptionW and SQLGetConnectOptionW.

  • Where TimesTen connection attributes are mentioned as being equivalent to ODBC connection options, see "Connection Attributes" in Oracle TimesTen In-Memory Database Reference for additional information.

Table 10-9 Standard connection options (ODBC 2.5)

Option Notes

SQL_AUTOCOMMIT

No notes

SQL_MAX_ROWS

See "ODBC 2.5 function signatures that have changed" (refer to SQLGetStmtOption or SQLSetStmtOption there).

SQL_NOSCAN

No notes

SQL_ODBC_CURSORS

Supported for programs using a driver manager

SQL_OPT_TRACE

Supported for programs using a driver manager

SQL_OPT_TRACEFILE

Supported for programs using a driver manager

SQL_TXN_ISOLATION

Supported for vParam is SQL_TXN_READ_COMMITTED or SQL_TXN_SERIALIZABLE

See "Prefetching multiple rows of data" for information about the relationship between prefetching and isolation level. Also see "Concurrency control through isolation and locking" in Oracle TimesTen In-Memory Database Operations Guide and "Isolation" in Oracle TimesTen In-Memory Database Reference.


Table 10-10 TimesTen connection options (ODBC 2.5)

Option Notes

TT_CLIENT_TIMEOUT

This is for client/server only and has the same functionality as the TTC_Timeout TimesTen client connection attribute.

Also see "Choose SQL and PL/SQL timeout values" in Oracle TimesTen In-Memory Database Operations Guide for information about the relationship between timeout values.

TT_DYNAMIC_LOAD_ENABLE

See "Dynamic load configuration" in Oracle TimesTen Application-Tier Database Cache User's Guide. This has the same functionality as the DynamicLoadEnable TimesTen Cache general connection attribute.

TT_DYNAMIC_LOAD_ERROR_MODE

See "Returning dynamic load errors" in Oracle TimesTen Application-Tier Database Cache User's Guide. This has the same functionality as the DynamicLoadErrorMode TimesTen Cache connection attribute.

TT_GRID_ENABLED_DATABASE

Read-only (get). This indicates whether the database is from a TimesTen instance enabled for TimesTen Scaleout.

TT_NLS_LENGTH_SEMANTICS

See "Setting globalization options". This has the same functionality as the NLS_LENGTH_SEMANTICS general connection attribute. There is related information about the functionality in "Additional globalization features".

TT_NLS_NCHAR_CONV_EXCP

See "Setting globalization options". This has the same functionality as the NLS_NCHAR_CONV_EXCP general connection attribute. There is related information about the functionality in "Additional globalization features".

TT_NLS_SORT

See "Setting globalization options". This has the same functionality as the NLS_SORT general connection attribute. There is related information about the functionality in "Additional globalization features".

TT_NO_RECONNECT_ON_FAILOVER

Read-only (get). See "Configuration of automatic client failover". This indicates the setting of the TimesTen connection attribute TTC_NoReconnectOnFailover (for client connections only).

TT_PREFETCH_CLOSE

Set to TT_PREFETCH_CLOSE_ON to optimize query performance. The default setting is TT_PREFETCH_CLOSE_OFF. Refer to "Optimizing query performance" for details.

TT_REGISTER_FAILOVER_CALLBACK

See "Using automatic client failover in your application". This attribute is client-only. If you attempt to use it in TimesTen direct mode, SQL_SUCCESS is returned but no action is taken.

TT_REPLICATION_TRACK

See "Features for use with replication". For ODBC applications that use parallel replication and specify replication tracks, this has the same functionality as the ReplicationTrack general connection attribute, to specify a track number for the connection.

TT_ROLLBACK_REQUIRED_ON_FAILOVER

Read-only (get). See "Configuration of automatic client failover". This indicates the setting of the TimesTen connection attribute TTC_RollbackRequiredOnFailover (for client connections only).

TT_XACT_REQUIRES_FAILOVER_ROLLBACK

Read-only (get). If TTC_RollbackRequiredOnFailover is enabled, returns a nonzero value if the following are both true, or zero otherwise:

  • The connection has experienced a failover reconnection.

  • The application has not yet acknowledged, through a rollback call, that an open transaction may have been lost.

This is relevant only for client connections.


Option support for ODBC 2.5 SQLSetStmtOption and SQLGetStmtOption

Table 10-11 lists standard options supported by TimesTen for the ODBC 2.5 SQLSetStmtOption and SQLGetStmtOption functions, with notes about the support. Table 10-12 lists TimesTen-specific options. These functions enable you to set or retrieve statement option settings.

To set an option default value for all statements associated with a connection, use SQLSetConnectOption.

Notes:

An option setting through SQLSetConnectOption or SQLSetStmtOption overrides the setting of the corresponding connection attribute (as applicable).

Table 10-11 Standard statement options (ODBC 2.5)

Option Notes

SQL_MAX_ROWS

See "ODBC 2.5 function signatures that have changed".

SQL_NOSCAN

No notes

SQL_QUERY_TIMEOUT

See "Setting a timeout duration for SQL statements".


Note:

The SQL_MAX_LENGTH option can be set, but any specified value is overridden with 0 (return all available data).

Table 10-12 TimesTen statement options (ODBC 2.5)

Option Notes

TT_PREFETCH_COUNT

See "Prefetching multiple rows of data".

TT_QUERY_THRESHOLD

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.

TT_PRIVATE_COMMANDS

Commands are not shared with any other connection. See "PrivateCommands" in Oracle TimesTen In-Memory Database Reference.

TT_STMT_PASSTHROUGH_TYPE

Determines whether a specific prepared statement is passed through to Oracle Database by the passthrough feature of TimesTen Cache. The value returned by SQLGetStmtOption can be either TT_STMT_PASSTHROUGH_NONE or TT_STMT_PASSTHROUGH_ORACLE.

Note: In TimesTen, this option is supported only with SQLGetStmtOption.

See "Determining passthrough status". Also see "Setting a passthrough level" in Oracle TimesTen Application-Tier Database Cache User's Guide.


Column descriptor support for ODBC 2.5 SQLColAttributes

The SQLColAttributes 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.

Table 10-13 describes TimesTen-specific column descriptors.

Table 10-13 TimesTen column descriptors: SQLColAttributes

Descriptor Comment/description

TT_COLUMN_INLINE

Returns TRUE for columns with inline data, or FALSE otherwise. This is returned in the SQLColAttributes pfDesc parameter.

TT_COLUMN_LENGTH_SEMANTICS

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 SQLColAttributes rgbDesc parameter.

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 for additional information.


Information type support for ODBC 2.5 SQLGetInfo

This section covers support in the TimesTen ODBC 2.5 implementation for information types for the ODBC function SQLGetInfo.

Table 10-14 documents TimesTen support for standard information types introduced in ODBC 1.0 and 2.0, as well as ODBC 3.0 information types supported by the TimesTen ODBC 2.5 implementation (as indicated), noting the TimesTen-specific correct value or values returned.

See "Information type support for ODBC 3.5 SQLGetInfo" for TimesTen-specific information types, which are supported for both ODBC 3.5 and ODBC 2.5.

Table 10-14 TimesTen support for standard information types: SQLGetInfo (ODBC 2.5)

Information type Notes and correct values returned by TimesTen

SQL_ACCESSIBLE_PROCEDURES

"Y"

SQL_ACCESSIBLE_TABLES

"Y"

SQL_ACTIVE_CONNECTIONS

sb_DbConnMaxUser: Daemon connections limited to this value.

SQL_ACTIVE_STATEMENTS

0: Allocated from heap, no limit on concurrency.

SQL_AGGREGATE_FUNCTIONS

ODBC 3.0 information type supported by TimesTen ODBC 2.5 implementation. See "Information type support for ODBC 3.5 SQLGetInfo".

SQL_ALTER_TABLE

SQL_AT_ADD_COLUMN, SQL_AT_DROP_COLUMN

SQL_BOOKMARK_PERSISTENCE

0: Bookmarks persist through none of the operations.

SQL_COLUMN_ALIAS

"Y"

SQL_CONCAT_NULL_BEHAVIOR

SQL_CB_NON_NULL: Result is concatenation of column or columns with non-null values.

SQL_CONVERT_FUNCTIONS

SQL_FN_CVT_CAST

SQL_CONVERT_xxxx

0: CONVERT function not supported.

SQL_CONVERT_WCHAR

ODBC 3.0 information type supported by TimesTen ODBC 2.5 implementation. See "Information type support for ODBC 3.5 SQLGetInfo".

SQL_CONVERT_WLONGVARCHAR

ODBC 3.0 information type supported by TimesTen ODBC 2.5 implementation. See "Information type support for ODBC 3.5 SQLGetInfo".

SQL_CONVERT_WVARCHAR

ODBC 3.0 information type supported by TimesTen ODBC 2.5 implementation. See "Information type support for ODBC 3.5 SQLGetInfo".

SQL_CORRELATION_NAME

SQL_CN_ANY: Correlation names are supported and can be any valid user-defined name.

SQL_CREATE_VIEW

ODBC 3.0 information type supported by TimesTen ODBC 2.5 implementation. See "Information type support for ODBC 3.5 SQLGetInfo".

SQL_CURSOR_COMMIT_BEHAVIOR

SQL_CB_CLOSE: Close cursors. For prepared statements, the application can call SQLExecute on the statement without calling SQLPrepare again.

SQL_CURSOR_ROLLBACK_BEHAVIOR

SQL_CB_CLOSE: Close cursors. For prepared statements, the application can call SQLExecute on the statement without calling SQLPrepare again.

SQL_DATA_SOURCE_NAME

"": Empty string.

SQL_DATA_SOURCE_READ_ONLY

"N"

SQL_DATETIME_LITERALS

ODBC 3.0 information type supported by TimesTen ODBC 2.5 implementation. See "Information type support for ODBC 3.5 SQLGetInfo".

SQL_DEFAULT_TXN_ISOLATION

SQL_TXN_READ_COMMITTED: Dirty reads are not possible. Non-repeatable reads and phantoms are possible.

SQL_TXN_SERIALIZABLE: Transactions are serializable. Dirty reads, non-repeatable reads, or phantoms are now allowed.

SQL_DRIVER_HDBC

Pointer to driver connection handle.

SQL_DRIVER_HENV

Pointer to driver environment handle.

SQL_DRIVER_HLIB

NULL

Note: If you use a driver manager, this returns the pointer to the TimesTen library.

SQL_DRIVER_HSTMT

Pointer to driver statement handle.

SQL_DRIVER_NAME

The file name of the TimesTen ODBC driver library for your platform.

SQL_DRIVER_ODBC_VER

"3.51" for ODBC 3.5; "2.50" for ODBC 2.5.

SQL_DRIVER_VER

A string indicating the TimesTen version. For example, for TimesTen Release 18.1: "18.01.0001.0001 Oracle TimesTen version 18.1.4.1.0".

SQL_DROP_VIEW.

ODBC 3.0 information type supported by TimesTen ODBC 2.5 implementation. See "Information type support for ODBC 3.5 SQLGetInfo".

SQL_EXPRESSIONS_IN_ORDERBY

"Y"

SQL_FETCH_DIRECTION

SQL_FD_FETCH_NEXT

SQL_FILE_USAGE

SQL_FILE_NOT_SUPPORTED: Driver is not a single-tier driver.

SQL_GETDATA_EXTENSIONS

SQL_GD_ANY_COLUMN: SQLGetData can be called for any unbound column, including those before the last bound column. The columns must be called in order of ascending column number unless SQL_GD_ANY_ORDER is also returned.

SQL_GD_ANY_ORDER: SQLGetData can be called for unbound columns in any order. Note that SQLGetData can be called only for columns after the last bound column unless SQL_GD_ANY_COLUMN is also returned.

SQL_GD_BOUND: SQLGetData can be called for bound columns in addition to unbound columns. A driver cannot return this value unless it also returns SQL_GD_ANY_COLUMN.

SQL_GROUP_BY

SQL_GB_GROUP_BY_CONTAINS_SELECT: GROUP BY clause must contain all nonaggregated columns in the select list, but can also contain columns that are not in the select list. For example:

SELECT dept, MAX(salary) FROM employee 
GROUP BY dept, age;

SQL_IDENTIFIER_CASE

SQL_IC_UPPER: SQL identifiers are not case-sensitive and are stored in uppercase in system catalog.

SQL_IDENTIFIER_QUOTE_CHAR

""": A string with one quote mark, which is the quote character.

SQL_KEYWORDS

TT_SQL_KEYWORDS: A character string that contains a comma-separated list of TimesTen-specific SQL keywords.

See "TimesTen SQL keywords for ODBC 2.5".

SQL_LIKE_ESCAPE_CLAUSE

"Y"

SQL_MAX_BINARY_LITERAL_LEN

16384

SQL_MAX_CHAR_LITERAL_LEN

YY_BUF_SIZE

SQL_MAX_COLUMN_NAME_LEN

Alias SQL_MAXIMUM_COLUMN_NAME_LENGTH

sb_ObjNameLenMax

SQL_MAX_COLUMNS_IN_GROUP_BY

Alias SQL_MAXIMUM_COLUMNS_IN_GROUP_BY

MAX_COLUMNS_IN_GB

SQL_MAX_COLUMNS_IN_INDEX

MAX_COLUMNS_IN_IDX

SQL_MAX_COLUMNS_IN_ORDER_BY

Alias SQL_MAXIMUM_COLUMNS_IN_ORDER_BY

MAX_COLUMNS_IN_OB

SQL_MAX_COLUMNS_IN_SELECT

Alias SQL_MAXIMUM_COLUMNS_IN_SELECT

MAX_COLUMNS_IN_SELECT

SQL_MAX_COLUMNS_IN_TABLE

Alias SQL_MAXIMUM_COLUMNS_IN_TABLE

MAX_COLUMNS_IN_TBL

SQL_MAX_CURSOR_NAME_LEN

Alias SQL_MAXIMUM_CURSOR_NAME_LENGTH

18

SQL_MAX_INDEX_SIZE

4194304

SQL_MAX_OWNER_NAME_LEN

sb_ObjNameLenMax

SQL_MAX_PROCEDURE_NAME_LEN

sb_NameLenMax - 1

SQL_MAX_QUALIFIER_NAME_LEN

0: No specific maximum length.

SQL_MAX_ROW_SIZE

4194304

SQL_MAX_STATEMENT_LEN

Alias SQL_MAXIMUM_STATEMENT_LENGTH

sb_SqlStringLenMax

SQL_MAX_TABLE_NAME_LEN

Alias SQL_MAXIMUM_TABLE_NAME_LENGTH

sb_ObjNameLenMax

SQL_MAX_TABLES_IN_SELECT

Alias SQL_MAXIMUM_TABLES_IN_SELECT

sb_SqlCorrMax

SQL_MAX_USER_NAME_LEN

Alias SQL_MAXIMUM_USER_NAME_LENGTH

sb_ObjNameLenMax

SQL_MULT_RESULT_SETS

"N"

SQL_MULTIPLE_ACTIVE_TXN

"Y"

SQL_NEED_LONG_DATA_LEN

"N"

SQL_NON_NULLABLE_COLUMNS

SQL_NNC_NON_NULL: Columns cannot be nullable. (The data source supports the NOT NULL column constraint in CREATE TABLE statements.)

SQL_NULL_COLLATION

SQL_NC_HIGH: Null values are sorted at the high end of the result set, depending on the ASC or DESC keyword.

SQL_NUMERIC_FUNCTIONS

SQL_FN_NUM_ABS, SQL_FN_NUM_CEILING, SQL_FN_NUM_FLOOR, SQL_FN_NUM_MOD, SQL_FN_NUM_POWER, SQL_FN_NUM_ROUND, SQL_FN_NUM_SIGN, SQL_FN_NUM_SQRT

SQL_ODBC_SQL_OPT_IEF

"N"

SQL_ODBC_VER

N/A, implemented by the driver manager.

SQL_OJ_CAPABILITIES

Alias SQL_OUTER_JOIN_CAPABILITIES

SQL_OJ_LEFT: Left outer joins supported.

SQL_OJ_RIGHT: Right outer joins supported.

SQL_OJ_NOT_ORDERED: Column names in the ON clause of the outer join do not have to be in the same order as their respective table names in the OUTER JOIN clause.

SQL_OJ_INNER: Inner table (right table in a left outer join or left table in a right outer join) can also be used in an inner join. This does not apply to full outer joins, which do not have an inner table.

SQL_OJ_ALL_COMPARISON_OPS: Comparison operator in the ON clause can be any of the ODBC comparison operators. If this bit is not set, only the equals (=) comparison operator can be used in outer joins.

SQL_ORDER_BY_COLUMNS_IN_SELECT

"Y"

SQL_OUTER_JOINS

"Y"

SQL_OWNER_TERM

"owner"

SQL_OWNER_USAGE

SQL_OU_DML_STATEMENTS: Schemas supported in all DML statements.

SQL_OU_PROCEDURE_INVOCATION: Schemas supported in the ODBC procedure invocation statement.

SQL_OU_TABLE_DEFINITION: Schemas supported in CREATE TABLE, CREATE VIEW, ALTER TABLE, DROP TABLE, and DROP VIEW statements.

SQL_OU_INDEX_DEFINITION: Schemas supported in CREATE INDEX and DROP INDEX statements.

SQL_OU_PRIVILEGE_DEFINITION: Schemas are supported in GRANT and REVOKE statements.

SQL_PARAM_ARRAY_ROW_COUNTS

ODBC 3.0 information type supported by TimesTen ODBC 2.5 implementation. See "Information type support for ODBC 3.5 SQLGetInfo".

SQL_PARAM_ARRAY_SELECTS

ODBC 3.0 information type supported by TimesTen ODBC 2.5 implementation. See "Information type support for ODBC 3.5 SQLGetInfo".

SQL_POS_OPERATIONS

0: Scrollable cursors not supported.

SQL_PROCEDURE_TERM

"procedure"

SQL_PROCEDURES

"Y"

SQL_QUALIFIER_LOCATION

0: Catalog names as qualifiers not supported.

SQL_QUALIFIER_NAME_SEPARATOR

NULL: Not supported.

SQL_QUALIFIER_TERM

"data store"

SQL_QUALIFIER_USAGE

0: Catalogs not supported.

SQL_QUOTED_IDENTIFIER_CASE

SQL_IC_SENSITIVE: Quoted identifiers in SQL are case-sensitive and stored in mixed-case in the system catalog.

SQL_ROW_UPDATES

"N"

SQL_SCROLL_OPTIONS

SQL_SO_FORWARD_ONLY: Cursors can scroll only forward.

SQL_SEARCH_PATTERN_ESCAPE

"\\"

SQL_SERVER_NAME

"": Empty string.

SQL_SPECIAL_CHARACTERS

"@#$": A string indicating the special characters.

SQL_SQL92_RELATIONAL_JOIN_OPERATORS

ODBC 3.0 information type supported by TimesTen ODBC 2.5 implementation. See "Information type support for ODBC 3.5 SQLGetInfo".

SQL_SQL92_VALUE_EXPRESSIONS

ODBC 3.0 information type supported by TimesTen ODBC 2.5 implementation. See "Information type support for ODBC 3.5 SQLGetInfo".

SQL_STRING_FUNCTIONS

SQL_FN_STR_CHAR, SQL_FN_STR_CONCAT, SQL_FN_STR_LCASE, SQL_FN_STR_LEFT, SQL_FN_STR_LENGTH, SQL_FN_STR_LOCATE, SQL_FN_STR_LOCATE_2, SQL_FN_STR_LTRIM, SQL_FN_STR_REPLACE, SQL_FN_STR_RIGHT, SQL_FN_STR_RTRIM, SQL_FN_STR_SOUNDEX, SQL_FN_STR_SPACE, SQL_FN_STR_SUBSTRING, SQL_FN_STR_UCASE

SQL_SUBQUERIES

SQL_SQ_CORRELATED_SUBQUERIES, SQL_SQ_COMPARISON, SQL_SQ_EXISTS, SQL_SQ_IN, SQL_SQ_INSQL_SQ_QUANTIFIED

SQL_SYSTEM_FUNCTIONS

SQL_FN_SYS_IFNULL, SQL_FN_SYS_USERNAME

SQL_TABLE_TERM

"table"

SQL_TIMEDATE_ADD_INTERVALS

SQL_FN_TSI_FRAC_SECOND, SQL_FN_TSI_SECOND, SQL_FN_TSI_MINUTE, SQL_FN_TSI_HOUR, SQL_FN_TSI_DAY, SQL_FN_TSI_WEEK, SQL_FN_TSI_MONTH, SQL_FN_TSI_QUARTER, SQL_FN_TSI_YEAR

SQL_TIMEDATE_DIFF_INTERVALS

SQL_FN_TSI_FRAC_SECOND, SQL_FN_TSI_SECOND, SQL_FN_TSI_MINUTE, SQL_FN_TSI_HOUR, SQL_FN_TSI_DAY, SQL_FN_TSI_WEEK, SQL_FN_TSI_MONTH, SQL_FN_TSI_QUARTER, SQL_FN_TSI_YEAR

SQL_TIMEDATE_FUNCTIONS

SQL_FN_TD_TIMESTAMPADD, SQL_FN_TD_NOW, SQL_FN_TD_TIMESTAMPDIFF

SQL_TXN_CAPABLE

Alias SQL_TRANSACTION_CAPABLE

SQL_TC_DDL_COMMIT: According to the ODBC 2.0 standard, this indicates that transactions can contain only DML statements, and that DDL statements encountered in a transaction cause the transaction to be committed. TimesTen implements Oracle Database semantics, which allow both DML and DDL in a transaction, but a DDL statement causes the transaction to commit.

SQL_TXN_ISOLATION_OPTION

Alias SQL_TRANSACTION_ISOLATION_OPTION

SQL_TXN_READ_COMMITTED, SQL_TXN_SERIALIZABLE

SQL_UNION

SQL_U_UNION: Data source supports UNION clause.

SQL_U_UNION_ALL: Data source supports ALL keyword in the UNION clause. (SQLGetInfo returns both SQL_U_UNION and SQL_U_UNION_ALL in this case.)

SQL_USER_NAME

At runtime, returns a string containing the user name.


Note:

If you use InfoType value SQL_DRIVER_HDBC, SQL_DRIVER_HENV, or SQL_DRIVER_HSTMT, refer to "ODBC 2.5 function signatures that have changed".

TimesTen SQL keywords for ODBC 2.5

This section lists the TimesTen SQL keywords returned for SQL_KEYWORDS in a SQLGetInfo call.

This is different from the list of TimesTen reserved words. For that list, see "Reserved Words" in Oracle TimesTen In-Memory Database SQL Reference.

ABS, ACCOUNT, ACTIVE, ADDMONTHS, ADMIN, AFFINITY, AGENT, AGING, ALLOW, ASCIISTR, ASYNCHRONOUS, AUTHID, AUTOREFRESH, AWT, BATCH, BIG, BIGINT, BINARY, BINARY_DOUBLE, BINARY_DOUBLE_INFINITY, BINARY_DOUBLE_NAN, BINARY_FLOAT, BINARY_FLOAT_INFINITY, BINARY_FLOAT_NAN, BITAND, BITMAP, BITNOT, BITOR, BITXOR, BLOB, BODY, BYTE, BYTES, CACHE, CACHEONLY, CACHE_MANAGER, CALL, CHECKING, CHR, CLOB, COLUMNAR, COMMITTED, COMPILE, COMPLETE, COMPRESS, CONCAT, CONFLICT, CONFLICTS, CS, CUBE, CURRENT_SCHEMA, CURRVAL, CYCLE, DATASTORE, DATASTORE_OWNER, DAYS, DEBUG, DECODE, DEFINED, DEFINER, DEFINITION, DELETE_FT, DESTROY, DICTIONARY, DIRECTORY, DISABLE, DISTRIBUTE, DUPLICATE, DURABLE, DURATION, DYNAMIC, ELEMENT, ENABLE, ENCRYPTED, ENDSEQ, EVERY, EXACT, EXCLUDE, EXIT, EXPIRE, EXTERNALLY, FACTOR, FAILTHRESHOLD, FAST, FIRST_VALUE, FLUSH, FOLLOWING, FORCE, FORMAT, FUNCTION, GETDATE, GRID, GROUPING, GROUPING_ID, GROUP_ID, HASH, HEARTBEAT, HIERARCHY, HOURS, ID, IDENTIFIED, IGNORE, INCREMENT, INCREMENTAL, INFINITE, INLINE, INSERTONLY, INSTANCE, INSTR, INSTR4, INSTRB, LAST_VALUE, LATENCY, LENGTH, LENGTH4, LENGTHB, LIBRARY, LIFETIME, LIMIT, LIMIT_FT, LOAD, LOAD_FT, LOCK, LOG, LONG, LRU, MASTER, MASTERIP, MATCHED, MATERIALIZED, MAXVALUE, MAXVALUES, MERGE, MIGRATORY, MILLISECOND, MILLISECONDS, MINUS, MINUTES, MINVALUE, MOD, MODE, MODIFY, MULTI, NAME, NAN, NCHAR_CS, NCHR, NCLOB, NEXTVAL, NLSSORT, NOBATCH, NOCACHE, NOCYCLE, NOMAXVALUE, NOMINVALUE, NONDURABLE, NOORDER, NOWAIT, NULLS, NUMBER, NUMTODSINTERVAL, NUMTOYMINTERVAL, NVARCHAR, NVARCHAR2, NVL, OFF, OPTIMIZED, ORACLE, ORA_CHAR, ORA_DATE, ORA_FLOAT, ORA_NCHAR, ORA_NVARCHAR2, ORA_SYSDATE, ORA_TIMESTAMP, ORA_VARCHAR2, OUT, OVER, PACKAGE, PAGES, PAIR, PARALLEL, PARTITION, PASSWORD, PAUSED, PLSQL_WARNINGS, PORT, PRECEDING, PRIORITY, PRIVATE, PROPAGATE, PROPAGATOR, PUBLICREAD, PUBLICROW, QUIT, RANGE, RC, READERS, READONLY, RECEIPT, REFERENCE, REFRESH, REFRESH_FT, RELAXED, RELEASE, RENAME, REPLACE, REPLICATION, REPORT, REPORTING, REQUEST, RESUME, RETURN, RETURNING, REUSE, RLE, ROLLUP, ROUTE, ROW, ROWID, ROWIDONLY, ROWNUM, RR, RTRIM, RU, SECONDS, SELF, SEQBATCH, SEQCACHE, SEQUENCE, SERVICES, SETS, SETTINGS, SPECIFICATION, SQL_TSI_DAY, SQL_TSI_FRAC_SECOND, SQL_TSI_HOUR, SQL_TSI_MINUTE, SQL_TSI_MONTH, SQL_TSI_QUARTER, SQL_TSI_SECOND, SQL_TSI_WEEK, SQL_TSI_YEAR, STANDARD, STANDBY, START, STARTSEQ, STATE, STATIC, STOPPED, STORE, SUBSCRIBER, SUBSCRIBERIP, SUBSTR, SUBSTR4, SUBSTRB, SUSPEND, SYNCHRONOUS, SYNONYM, SYSDATE, SYSDBA, SYSTEM, TAG, TIMEOUT, TIMESTAMPADD, TIMESTAMPDIFF, TINYINT, TO_BLOB, TO_CHAR, TO_CLOB, TO_DATE, TO_LOB, TO_NCLOB, TO_NUMBER, TO_TIMESTAMP, TRAFFIC, TRANSMIT, TREE, TRUNC, TRUNCATE, TRUSTED, TT_BIGINT, TT_BINARY, TT_CHAR, TT_DATE, TT_DECIMAL, TT_HASH, TT_INT, TT_INTEGER, TT_INTERVAL, TT_NCHAR, TT_NVARCHAR, TT_SMALLINT, TT_SYSDATE, TT_TIME, TT_TIMESTAMP, TT_TINYINT, TT_VARBINARY, TT_VARCHAR, TWOSAFE, UID, UNBOUNDED, UNISTR, UNLOAD, UNLOCK, USE, USERMANAGED, VARBINARY, VARCHAR2, WAIT, WRAPPED, WRITETHROUGH, XLA, XML, XYZZY

ODBC API incompatibilities with previous versions of TimesTen

The TimesTen 18.1 release introduces changes that impact ODBC applications used with previous versions of TimesTen.

The TimesTen driver is ODBC-compliant; however, in this release, more recent ODBC header files are provided in the include directory of the TimesTen installation on Linux and UNIX platforms.

Changes were also made to update some ODBC types and functions to make them 64-bit compatible.

These and other changes may necessitate code changes on any platform. ODBC changes requiring code updates for ODBC applications fall into the following categories:

  • ODBC function changes

    • Function signature changes: A number of function signatures have changed for 64-bit programming.

    • Changes to the size of option or attribute values: This refers to values of connection options, statement options, column attributes, or driver and data source information, either passed or returned. These are now 64-bit values in the circumstances indicated below.

  • ODBC data type changes

Important:

Even if none of the required code changes applies to your applications, you should recompile and relink existing ODBC applications the first time you use a TimesTen 18.1 release.

If your existing TimesTen ODBC application uses features described in these sections, you must update the application as necessary:

ODBC 3.5 function signatures that have changed

In previous releases, TimesTen provided partial support for ODBC 3.5 functionality, including:

  • Handle allocation methods

  • Diagnostic records

  • Wide character functions

  • Attribute set and get functions for handles

  • SQLColAttribute

  • Miscellaneous functions that map directly to 2.5 functionality such as SQLCloseCursor and SQLEndTran

The functions listed in Table 10-15 have changes to the signature or changes to the size of attribute values, requiring code updates for ODBC 3.5 applications, as indicated. Sizes of attribute values apply to values of connection and statement attributes, either passed or returned.

Notes:

  • Signature changes apply to either 64-bit or 32-bit environments. Size changes in option and attribute values apply only to 64-bit environments.

  • TimesTen ODBC does not return values for options or attributes related to features that TimesTen does not support. For example: SQL_ATTR_ASYNC_ENABLE, SQL_ATTR_ENLIST_IN_DTC, SQL_ATTR_CURSOR_SCROLLABLE, SQL_ATTR_CURSOR_SENSITIVITY, SQL_ATTR_FETCH_BOOKMARK_PTR, SQL_ATTR_METADATA_ID, SQL_ATTR_RETRIEVE_DATA, SQL_ATTR_SIMULATE_CURSOR, SQL_ATTR_USE_BOOKMARKS.

Table 10-15 Changes in ODBC 3.5 functions

Function Signature changes Size changes in option and attribute values

SQLColAttribute

SQLColAttributeW

N/A

On UNIX platforms: For the following FieldIdentifier values, a 64-bit value is returned in *NumericAttributePtr:


SQL_DESC_AUTO_UNIQUE_VALUE
SQL_DESC_CASE_SENSITIVE
SQL_DESC_CONCISE_TYPE
SQL_DESC_COUNT
SQL_DESC_DISPLAY_SIZE
SQL_DESC_FIXED_PREC_SCALE
SQL_DESC_LENGTH
SQL_DESC_NULLABLE
SQL_DESC_NUM_PREC_RADIX
SQL_DESC_OCTET_LENGTH
SQL_DESC_PRECISION
SQL_DESC_SCALE
SQL_DESC_SEARCHABLE
SQL_DESC_TYPE
SQL_DESC_UNNAMED
SQL_DESC_UNSIGNED
SQL_DESC_UPDATABLE

SQLGetConnectAttr

SQLGetConnectAttrW

*ValuePtr must be SQLUINTEGER or SQLULEN, depending on the attribute you are getting.

Note: TimesTen-specific attributes (prefixed with TT_) remain the same data types.

On UNIX platforms: For the following attributes, a 64-bit value is returned in *ValuePtr:


SQL_ATTR_ASYNC_ENABLE
SQL_ATTR_ENLIST_IN_DTC
SQL_ATTR_ODBC_CURSORS
SQL_ATTR_QUIET_MODE

SQLGetStmtAttr

SQLGetStmtAttrW

*ValuePtr must be SQLUINTEGER or SQLULEN, depending on the attribute you are getting.

Note: TimesTen-specific attributes (prefixed with TT_) remain the same data types.

On UNIX platforms: For the following attributes, a 64-bit value is returned in *ValuePtr:


SQL_ATTR_APP_PARAM_DESC
SQL_ATTR_APP_ROW_DESC
SQL_ATTR_ASYNC_ENABLE
SQL_ATTR_CONCURRENCY
SQL_ATTR_CURSOR_SCROLLABLE
SQL_ATTR_CURSOR_SENSITIVITY
SQL_ATTR_CURSOR_TYPE
SQL_ATTR_ENABLE_AUTO_IPD
SQL_ATTR_FETCH_BOOKMARK_PTR
SQL_ATTR_ROWS_FETCHED_PTR
SQL_ATTR_IMP_PARAM_DESC
SQL_ATTR_IMP_ROW_DESC
SQL_ATTR_KEYSET_SIZE
SQL_ATTR_MAX_LENGTH
SQL_ATTR_MAX_ROWS
SQL_ATTR_METADATA_ID
SQL_ATTR_NOSCAN
SQL_ATTR_PARAM_BIND_OFFSET_PTR
SQL_ATTR_PARAM_BIND_TYPE
SQL_ATTR_PARAM_OPERATION_PTR
SQL_ATTR_PARAM_STATUS_PTR
SQL_ATTR_PARAMS_PROCESSED_PTR
SQL_ATTR_PARAMSET_SIZE
SQL_ATTR_QUERY_TIMEOUT
SQL_ATTR_RETRIEVE_DATA
SQL_ATTR_ROW_ARRAY_SIZE
SQL_ATTR_ROW_BIND_OFFSET_PTR
SQL_ATTR_ROW_NUMBER
SQL_ATTR_ROW_OPERATION_PTR
SQL_ATTR_ROW_STATUS_PTR
SQL_ATTR_SIMULATE_CURSOR
SQL_ATTR_USE_BOOKMARKS

SQLSetConnectAttr

SQLSetConnectAttrW

*ValuePtr must be SQLUINTEGER or SQLULEN, depending on the attribute you are setting.

Note: TimesTen-specific attributes (prefixed with TT_) remain the same data types.

On UNIX platforms: For the following attributes, a 64-bit value is passed in *ValuePtr:


SQL_ATTR_ASYNC_ENABLE
SQL_ATTR_ENLIST_IN_DTC
SQL_ATTR_ODBC_CURSORS
SQL_ATTR_QUIET_MODE

SQLSetStmtAttr

SQLSetStmtAttrW

*ValuePtr must be SQLUINTEGER or SQLULEN, depending on the attribute you are setting.

Note: TimesTen-specific attributes (prefixed with TT_) remain the same data types.

On UNIX platforms: For the following attributes, a 64-bit value is passed in *ValuePtr:


SQL_ATTR_APP_PARAM_DESC
SQL_ATTR_APP_ROW_DESC
SQL_ATTR_ASYNC_ENABLE
SQL_ATTR_CONCURRENCY
SQL_ATTR_CURSOR_SCROLLABLE
SQL_ATTR_CURSOR_SENSITIVITY
SQL_ATTR_CURSOR_TYPE
SQL_ATTR_ENABLE_AUTO_IPD
SQL_ATTR_FETCH_BOOKMARK_PTR
SQL_ATTR_IMP_PARAM_DESC
SQL_ATTR_IMP_ROW_DESC
SQL_ATTR_KEYSET_SIZE
SQL_ATTR_MAX_LENGTH
SQL_ATTR_MAX_ROWS
SQL_ATTR_METADATA_ID
SQL_ATTR_NOSCAN
SQL_ATTR_PARAM_BIND_OFFSET_PTR
SQL_ATTR_PARAM_BIND_TYPE
SQL_ATTR_PARAM_OPERATION_PTR
SQL_ATTR_PARAM_STATUS_PTR
SQL_ATTR_PARAMS_PROCESSED_PTR
SQL_ATTR_PARAMSET_SIZE
SQL_ATTR_QUERY_TIMEOUT
SQL_ATTR_RETRIEVE_DATA
SQL_ATTR_ROW_ARRAY_SIZE
SQL_ATTR_ROW_BIND_OFFSET_PTR
SQL_ATTR_ROW_NUMBER
SQL_ATTR_ROW_OPERATION_PTR
SQL_ATTR_ROW_STATUS_PTR
SQL_ATTR_ROWS_FETCHED_PTR
SQL_ATTR_SIMULATE_CURSOR
SQL_ATTR_USE_BOOKMARKS

ODBC 2.5 function signatures that have changed

The functions listed in Table 10-16 have changes to the signature or changes to the size of option or attribute values, requiring code updates for ODBC 2.5 applications, as indicated. Sizes of option or attribute values apply to values of connection options, statement options, column attributes, or driver and data source information, either passed or returned.

Table 10-16 Changes in ODBC 2.5 functions

Function Signature changes Size changes in option and attribute values

SQLColAttributes

SQLColAttributesW

N/A

On Linux and UNIX platforms: For the following fDescType values, a SQLLEN value is returned in *pfDesc:


SQL_COLUMN_COUNT
SQL_COLUMN_DISPLAY_SIZE
SQL_COLUMN_LENGTH
SQL_DESC_AUTO_UNIQUE_VALUE
SQL_DESC_CASE_SENSITIVE
SQL_DESC_CONCISE_TYPE
SQL_DESC_FIXED_PREC_SCALE
SQL_DESC_SEARCHABLE
SQL_DESC_UNSIGNED
SQL_DESC_UPDATABLE

SQLGetConnectOption

SQLGetConnectOptionW

The Value parameter must be SQLUINTEGER or SQLULEN, depending on the option you are getting.

Note: TimesTen-specific options (prefixed with TT_) remain the same data types.

On Linux and UNIX platforms: For the option SQL_ATTR_QUIET_MODE, an HWND value (void * pointer to a window) is returned in Value.

SQLGetInfo

SQLGetInfoW

N/A

On Linux and UNIX platforms: For the following InfoType values, a SQLPOINTER value is returned in *InfoValuePtr:


SQL_DRIVER_HDBC
SQL_DRIVER_HENV
SQL_DRIVER_HSTMT

SQLGetStmtOption

The Value parameter must be SQLUINTEGER or SQLULEN, depending on the option you are getting.

Note: TimesTen-specific options (prefixed with TT_) remain the same data types.

On Linux and UNIX platforms: For the following options, a SQLPOINTER value is returned in Value:


SQL_KEYSET_SIZE
SQL_MAX_LENGTH
SQL_MAX_ROWS
SQL_ROWSET_SIZE

SQLParamOptions

On Linux and UNIX platforms: The crow and pirow parameters are now declared as SQLULEN.

N/A

SQLSetConnectOption

SQLSetConnectOptionW

The Value parameter must be SQLUINTEGER or SQLULEN, depending on the option you are setting.

Note: TimesTen-specific options (prefixed with TT_) remain the same data types.

On Linux and UNIX platforms: For the option SQL_ATTR_QUIET_MODE, an HWND value (void * pointer to a window) is passed in Value.

SQLSetPos

TimesTen does not support scrollable cursors. This function returns a "Driver not capable" error (S1C00).

Note: The ODBC definition of SQLSETPOSIROW, the data type for the irow parameter, has changed. (See the next section, "ODBC data types that have changed".)

N/A

SQLSetStmtOption

The Value parameter must be SQLUINTEGER or SQLULEN, depending on the option you are setting.

Note: TimesTen-specific options (prefixed with TT_) remain the same data types.

On Linux and UNIX platforms: For the following options, a SQLPOINTER value is passed in Value:


SQL_KEYSET_SIZE
SQL_MAX_LENGTH
SQL_MAX_ROWS
SQL_ROWSET_SIZE

ODBC data types that have changed

Table 10-17 summarizes changes to data types that require code updates for ODBC applications.

Table 10-17 ODBC 2.5 data types that have changed

Data types Explanation

HANDLE
HINSTANCE

On Linux and UNIX platforms: These data types have been redefined as (void *).


SQLROWCOUNT
SQLROWSETSIZE
SQLTRANSID

These data types have been deprecated. Use SQLULEN instead.


SQLROWOFFSET

This data type has been deprecated. Use SQLLEN instead.


SQLSETPOSIROW

On Linux and UNIX platforms: This data type has been redefined as SQLULEN. It is advisable to use SQLULEN directly instead.