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 you enable access to LOB columns, the CLI maps
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:
- SQLGetTypeInfo() will return CLOB, BLOB and DBCLOB
characteristics when called with SQL_LONGVARCHAR, SQL_LONGVARBINARY
or SQL_LONGVARGRAPHIC.
- The following functions will return SQL_LONGVARCHAR, SQL_LONGVARBINARY
or SQL_LONGVARGRAPHIC when describing CLOB, BLOB or DBCLOB data types:
- SQLColumns()
- SQLSpecialColumns()
- SQLDescribeCol()
- SQLColAttribute()
- SQLProcedureColumns()
- LONG VARCHAR and LONG VARCHAR FOR BIT DATA will continue to be
described as SQL_LONGVARCHAR and SQL_LONGVARBINARY.
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.