#define SQL_TEXT Latin_Text
#include <sqltypes_td.h>
#define BUFFER_SIZE 100000
void concat2( LOB_LOCATOR *a,
LOB_LOCATOR *b,
LOB_RESULT_LOCATOR *result,
char sqlstate[6] )
{
FNC_LobLength_t actlen;
BYTE buffer[BUFFER_SIZE];
LOB_CONTEXT_ID id;
int trunc_err = 0;
/* Append the first argument. */
FNC_LobOpen(*a, &id, 0, 0);
while( FNC_LobRead(id, buffer, BUFFER_SIZE, &actlen) == 0
&& !trunc_err )
trunc_err = FNC_LobAppend(*result, buffer, actlen, &actlen);
FNC_LobClose(id);
...
}