Calling Teradata Library Functions - Advanced SQL Engine - Teradata Database

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
rin1593638965306.ditamap
dita:ditavalPath
rin1593638965306.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantageā„¢

Calling most of the Teradata library functions in an external stored procedure that uses CLIv2 involves several expensive context switches because the external stored procedure uses a different interface mode to execute most of the Teradata library functions.

Additionally, some of the Teradata library functions require that the external stored procedure wait for any outstanding CLIv2 requests to complete before calling them.

The exceptions are FNC_malloc and FNC_free, which do not incur any additional overhead.

The best practice for an external stored procedure that use CLIv2 to execute SQL is to use Teradata library functions judiciously.

For details on which library functions must wait for outstanding CLIv2 requests to complete before they are called, see C Library Functions.