Specifying the Class Name, Method Name, and JAR or ZIP Identifier - 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™

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 Vantage invokes when the UDF is specified in an SQL statement.