DB2 10.5 for Linux, UNIX, and Windows

LOB usage in ODBC applications

You can still access LOB columns from ODBC-compliant applications by setting the LongDataCompat configuration keyword in the initialization file, or by setting the SQL_ATTR_LONGDATA_COMPAT connection attribute using SQLSetConnectAttr().

Once this is done, CLI will map the ODBC long data types to the DB2® LOB data types.

Existing ODBC-compliant applications use SQL_LONGVARCHAR and SQL_LONGVARBINARY instead of the DB2 BLOB and CLOB data types. You can still access LOB columns from these ODBC-compliant applications by setting the LongDataCompat configuration keyword in the initialization file, or setting the SQL_ATTR_LONGDATA_COMPAT connection attribute using SQLSetConnectAttr(). Once this is done, CLI will map the ODBC long data types to the DB2 LOB data types. The LOBMaxColumnSize configuration keyword allows you to override the default COLUMN_SIZE for LOB data types.

When this mapping is in effect:

The default setting for SQL_ATTR_LONGDATA_COMPAT is SQL_LD_COMPAT_NO; that is, mapping is not in effect.

With mapping in effect, ODBC applications can retrieve and input LOB data by using the SQLGetData(), SQLPutData() and related functions.