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

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
qwr1571437338192.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1147
lifecycle
previous
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.