EXECUTE FUNCTION command. Additionally, a
UDTF can be executed as a table function
within a SELECT statement.
Execute UDF/UDTF Syntax
Execute UDTF Table Function Syntax
<function name> should be the name of an existing UDF.
Function Parameters
The following are the available function parameters that may be passed to a UDF in anEXECUTE FUNCTION or table function call, along with their
corresponding function values.
INPUT_TABLE_NAMES
INPUT_TABLE_NAMES
Optional set of “tables” that will be used as input to the UDF/UDTF, specified as a set of
queries defining the source data for each “table”. The value of this parameter is either the
INPUT_TABLE or INPUT_TABLES function, depending on the number of input “tables”.| Value | Description |
|---|---|
INPUT_TABLE(<query>) | If only one input table is needed, it can be passed by query or by name to the INPUT_TABLE function; e.g.: |
INPUT_TABLES(<queries>) | If more than one input table is needed, each can be passed via query as a list to the INPUT_TABLES function; e.g.: |
OUTPUT_TABLE_NAMES
OUTPUT_TABLE_NAMES
Optional set of tables that will be used as output, specified as a set of names passed as a
comma-delimited list of strings to the
OUTPUT_TABLES function; e.g.:PARAMS
PARAMS
Optional list of parameters to pass to the function, specified as a set of key/value pairs
passed as a comma-delimited list of
<key> = '<value>' assignments to the KV_PAIRS
function; e.g.:OPTIONS
OPTIONS
Optional list of function execution options, specified as a set of key/value pairs passed as a
comma-delimited list of All valid options from Execute Proc
can be used here.
<key> = '<value>' assignments to the KV_PAIRS function; e.g.:Examples
To execute theudf_st UDF, specifying an input and output table and the hint
to save runtime statistics:
Execute UDF Example
UDTF_ST UDTF, specifying an input table and
returning the output as the result set of a SELECT statement:
Execute UDTF Table Function Example