Example: XML Parameter in a Java UDF

Teradata Vantageā„¢ XML Data Type

brand
Software
Teradata Vantage
prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1140-162K
REPLACE FUNCTION get_XML(X1 XML)
RETURNS INTEGER
LANGUAGE JAVA
NO SQL
PARAMETER STYLE JAVA 
EXTERNAL NAME 'UDF_JAR:UserDefinedFunctions.get_XML';

public static int get_XML(java.sql.SQLXML xml_var) throws SQLException

Alternatively, you can define the function as follows:

REPLACE FUNCTION get_XML(X1 XML)
RETURNS INTEGER
LANGUAGE JAVA
NO SQL
PARAMETER STYLE JAVA 
EXTERNAL NAME 'UDF_JAR:UserDefinedFunctions.get_XML(java.sql.SQLXML) returns int';

public static int get_XML(java.sql.SQLXML xml_var) throws SQLException