Appending Data to a Large Object Result | Teradata Vantage - Appending Data to a Large Object Result - Analytics Database - Teradata Vantage

SQL External Routine Programming

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-03-30
dita:mapPath
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
qnu1472247494689
lifecycle
latest
Product Category
Teradata Vantageā„¢

A UDF that declares the result as a LOB_RESULT_LOCATOR type must use the FNC_LobAppend library function to append a sequence of bytes to the result.

The following code excerpt modifies the preceding code excerpt to show how to append data to a LOB_RESULT_LOCATOR result:

#define BUFFER_SIZE 500
   
void do_something ( LOB_LOCATOR *a,
                    LOB_RESULT_LOCATOR *result,
                    char sqlstate[6] )
{
   BYTE            buffer[BUFFER_SIZE];
   FNC_LobLength_t actlen;
   LOB_CONTEXT_ID  id;
   
   FNC_LobOpen(*a, &id, 0, BUFFER_SIZE);
   FNC_LobRead(id, buffer, BUFFER_SIZE, &actlen);
   FNC_LobAppend(*result, buffer, actlen, &actlen);
   FNC_LobClose(id);
   
    ...
   
}