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.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™

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.