16.20 - Specifying the Class Name, Method Name, and JAR or ZIP Identifier - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
16.20
Release Date
April 2020
Content Type
Programming Reference
Publication ID
B035-1147-162K
Language
English (United States)

The CREATE FUNCTION and REPLACE FUNCTION statements provide the EXTERNAL NAME clause for specifying the identifier of the registered JAR or ZIP file, and the class and method name in the JAR or ZIP file that implements the function.

Consider the following CREATE FUNCTION statement:

CREATE FUNCTION factorial (x INTEGER)
   RETURNS INTEGER
   LANGUAGE JAVA
   NO SQL
   PARAMETER STYLE JAVA
   RETURNS NULL ON NULL INPUT
   EXTERNAL NAME 'JarUDF:UDFExample.fact';

where:

THIS part of the EXTERNAL NAME clause … Specifies the …
JarUDF identifier of the registered JAR file that was provided to the SQLJ.INSTALL_JAR procedure.
UDFExample name of the class in the registered JAR file that implements the Java UDF.
fact method name in the specified class that Teradata Database invokes when the UDF is specified in an SQL statement.