17.10 - Installing a Library of General Global Functions - 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)

Another way to provide general global functions that UDFs can reference is to install a separate library of functions on the database on all nodes.

Here is an example that uses the package name clause of the CREATE FUNCTION statement to install a library of functions:

CREATE FUNCTION UDF1(A CHAR(30))
RETURNS INTEGER
  ...
EXTERNAL NAME 'SP!/usr/local/lib/libGenUdfs.so!F!udf1'

where libGenUdfs.so is a shared object file containing the library of functions that UDF1 can call and udf1 is the function entry point name in the shared object file for UDF1.

The shared object file must already be installed on the system and distributed to all its nodes before you use the CREATE FUNCTION statement. If you migrate to another system, you must copy the shared object file to /usr/local/lib on the target system before starting the database migration.

For more information on installing libraries, see Administration.