Example: SQL UDF with RETURN clause

Teradata Vantageā„¢ JSON Data Type

brand
Software
Teradata Vantage
prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1150-162K
This example shows an SQL UDF with a RETURN expression that evaluates to JSON type.
CREATE FUNCTION New_Funct ()
 RETURNS JSON(100)
 LANGUAGE SQL
CONTAINS SQL
DETERMINISTIC
SPECIFIC New_Funct
SQL SECURITY DEFINER
COLLATION INVOKER
INLINE TYPE 1
 RETURN (new JSON('[1,2,3]'));