17.20 - Inserting LOB Data - ODBC Driver for Teradata

ODBC Driver for Teradata® User Guide

Product
ODBC Driver for Teradata
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2022-06-21
dita:mapPath
uqj1639470627591.ditamap
dita:ditavalPath
nkw1500504256726.ditaval
dita:id
ktb1507075385726

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.