Instead of accessing smart large objects using the ifx_lo functions, you can access smart large objects using the standard ODBC API.
Operations supported when accessing smart large objects using the standard ODBC API include select, insert, update, and delete for CLOB and BLOB data types. You cannot access BYTE and TEXT smart large objects in this way.
You can use the INFX_LO_AUTOMATIC_ATTR attribute to tell the database server whether you will access smart large objects using the ODBC api or using ifx_lo functions. If the application enables the INFX_LO_AUTOMATIC_ATTR attribute as a connection attribute, all statements for that connection inherit the attribute value. To change this attribute value per statement, you have to set and reset it as a statement attribute. If you enable this attribute for the statement, the application can access the smart large object using the standard ODBC way, as previously described. If you do not enable this attribute for the statement, the application accesses smart large objects using ifx_lo functions. The application cannot use the ifx_lo functions if this attribute is enabled for the statement.
You can also enable the INFX_LO_AUTOMATIC_ATTR attribute by turning on the Report Standard ODBC Types option under the Advanced tab of the ODBC Administration for Informix Driver DSN.
SQLDescribeCol for a CLOB data type column returns SQL_LONGVARCHAR for the DataPtrType. SQLDescribeCol for a BLOB data type column returns SQL_LONGVARBINARY, if the INFX_LO_AUTOMATIC_ATTR attribute is enabled for that statement.
SQLColAttributes for a CLOB data type column returns SQL_LONGVARCHAR for the Field Identifier of SQL_DESC_TYPE, whereas for the BLOB data type column it returns SQL_LONGVARBINARY only if the INFX_LO_AUTOMATIC_ATTR attribute is enabled for that statement.
When you insert, update, or delete a CLOB data type, the application binds the CLOB data type using SQLBindParameter with C type as SQL_C_CHAR and SQL type as SQL_LONGVARCHAR.
When you insert, update, or delete a BLOB data type, the application binds BLOB data type using SQLBindParameter with C type as SQL_C_BINARY and SQL type as SQL_LONGVARBINARY.
IBM Informix ODBC Driver performs insertion of smart large objects in the following way:
When you select a CLOB data type, the application binds the column's C type as SQL_C_CHAR. When you select a BLOB data type, the C type is bound as SQL_C_BINARY.
IBM Informix ODBC Driver selects smart large objects in the following way: