Inserting LOB Data - ODBC Driver for Teradata

ODBC Driver for Teradata User Guide

Product
ODBC Driver for Teradata
Release Number
16.10
Published
May 2017
Language
English (United States)
Last Update
2018-07-11
dita:mapPath
smj1488824663219.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 and it will rarely be feasible to insert the data in one single large chunk. Rather it is advisable to insert LOB data piecemeal.

The ODBC DATA_AT_EXEC feature should be used to implement this piecemeal insertion into the database. When using this feature, data are inserted separately from the request to insert these data.

See the sample program at Inserting LOB 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 which indicates that 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 in addition allows the total length of the data to be specified. For Teradata LOBs this length is optional.