Specifying the Class Name, Method Name, and JAR or ZIP Identifier - Analytics Database - Teradata Vantage

SQL External Routine Programming

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-03-30
dita:mapPath
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
qnu1472247494689
lifecycle
latest
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.