15.10 - Example: SQL UDF with RETURN clause - Teradata Database

Teradata Database Teradata JSON

prodname
Teradata Database
vrm_release
15.10
created_date
December 2015
category
Programming Reference
featnum
B035-1150-151K
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]'));