Inserting LOB Data - ODBC Driver for Teradata

ODBC Driver for Teradata® User Guide

Product
ODBC Driver for Teradata
Release Number
16.20
Published
August 2020
Language
English (United States)
Last Update
2020-08-25
dita:mapPath
fxv1527114222338.ditamap
dita:ditavalPath
Audience_PDF_product_legacy_odbc_include.ditaval
dita:id
B035-2526
lifecycle
previous
Product Category
Teradata Tools and Utilities

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.