Method Signature for Table UDFs - 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™

Syntax

public class class_name {
  ...
  public static void method_name (
    [ type input_param [,...] ]
    result_type result [,...]
  )
  {
    ...
  }
 ...
}

Syntax Elements

class_name
Java class name.
method_name
Java method name.
type
Data type of input_param, a Java primitive or class corresponding to the SQL data type of the input argument.
input_param
Input parameter for Java method. The signature must have an input_param for each parameter in the CREATE FUNCTION statement.
The maximum number of input parameters is 128.
result_type
Java primitive or class corresponding to the SQL data type in the RETURNS clause of the corresponding CREATE FUNCTION statement.
If the table UDF is defined with fixed result row specification, result_type is a Java primitive or class that matches the SQL data type of the corresponding column in the RETURNS TABLE clause of the CREATE FUNCTION statement.
If the table UDF is defined with dynamic result row specification, result_type is java.lang.Object[], because the actual data types of the result row arguments are unknown until function invocation.
result
Row result output parameter, determined by the corresponding CREATE FUNCTION or REPLACE FUNCTION definition.
If the table UDF is defined with fixed result row specification, the method signature has a result for each column in the RETURNS TABLE clause in the corresponding CREATE FUNCTION definition.
If the table UDF is defined with dynamic result row specification, the method signature has the maximum number of columns in the RETURNS TABLE VARYING COLUMNS clause in the corresponding CREATE FUNCTION definition. During execution, the Java method can invoke the Tbl.getColDef() method to get the actual result types.
The method must return at least one result row output argument.