External Stored Procedures That Use CLOB or BLOB Arguments - 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
Language
English (United States)
Last Update
2023-07-11
dita:mapPath
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1147
lifecycle
latest
Product Category
Teradata Vantageā„¢

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.