a problem about teradata UDFS

Extensibility

a problem about teradata UDFS

When I read the teradata documents, in the section about Table UDF, I was confused by the statement "The number and data types of the output parameters can be specified statically in the CREATE FUNCTION statement or dynamically at runtime in the SELECT statement that invokes the table function."

How can we specify the number and data types of the output parameters dynamically at runtime?

Tags (1)
1 REPLY
Teradata Employee

Re: a problem about teradata UDFS

If the table function is defined with a returns varying defition then the grammar to invoke it with specific types looks something like this:

select * from table (myfunc

    (

        test_100m.c1, test_100m.c2, test_100m.c3, test_100m.c4

                         ,test_100m.c5, test_100m.c6, test_100m.c7, test_100m.c8

    )

     RETURNS (outstr VARCHAR(2048))

    ) as d

order by 1

;