17.10 - External Stored Procedures That Use CLOB or BLOB Arguments - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1147-171K
Language
English (United States)

External stored procedures can define CLOB or BLOB input and output arguments, passing them by locator.

An external stored procedure can be called in a request that inputs inline CLOBs or BLOBs; however, an external stored procedure cannot be used in a request that returns an inline CLOB or BLOB. A workaround for this restriction is to create a stored procedure that calls the external stored procedure, which returns the CLOB or BLOB argument by locator to the stored procedure, which in turn returns the CLOB or BLOB.

The guidelines for defining external stored procedures that use CLOB or BLOB arguments are similar to the guidelines for defining UDFs that use CLOB or BLOB arguments. For details, see Defining Functions that Use LOB Types.

Note that in the C source code for the external stored procedure, you must use the FNC LOB access functions to access the value of the LOB passed into or out of the procedure. This includes the following functions:
  • FNC_LobOpen
  • FNC_LobRead
  • FNC_LobAppend
  • FNC_LobClose

For details about these and other LOB-related FNC functions, see C Library Functions.

The requirement for using the FNC LOB access functions also apply in order for the external stored procedure to return default LOB values.