16.20 - Inserting LOB Data - ODBC Driver for Teradata

ODBC Driver for Teradata® User Guide

prodname
ODBC Driver for Teradata
vrm_release
16.20
created_date
August 2020
category
User Guide
featnum
B035-2526-108K

To insert LOB data, ODBC programs have to take into account that the size of LOB data may be very large; it will rarely be feasible to insert the data in one single large chunk. Teradata recommends inserting LOB data piecemeal.

Use the ODBC DATA_AT_EXEC feature to implement this piecemeal insertion into the database by inserting the data separately from the request to insert these data.

The following ODBC identifiers are available to specify the use of DATA_AT_EXEC:
  • SQL_LEN_DATA_AT_EXEC(LEN)
  • SQL_DATA_AT_EXEC

SQL_DATA_AT_EXEC is a pseudo length that indicates the length is unknown at the time when the request to insert data is made and that data will be supplied later, possibly in several chunks.

SQL_LEN_DATA_AT_EXEC is a macro which has the same effect as SQL_DATA_AT_EXEC, and allows the total length of the data to be specified. For Teradata LOBs, this length is optional.