16.20 - Example Using FNC_LobRead - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
16.20
Release Date
April 2020
Content Type
Programming Reference
Publication ID
B035-1147-162K
Language
English (United States)
#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_LobClose(id);

   ...

}