SQL UDF Return JSON Type Example | VantageCloud Lake - Example: SQL UDF with RETURN Clause - Teradata VantageCloud Lake

Lake - Working with SQL

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2025-11-21
dita:mapPath
jbe1714339405530.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
jbe1714339405530

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]'));