Example: Combine a JSON ARRAY and a JSON Expression and Specify the Result Is a JSON ARRAY - Advanced SQL Engine - Teradata Database

JSON Data Type

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
gzn1554761068186.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1150
lifecycle
previous
Product Category
Teradata Vantageā„¢
Combine a JSON array and an expression that evaluates to a JSON array and specify 'ARRAY' as the result. Note, the result is implicitly a JSON array even if the 'ARRAY' parameter is not specified.
The example uses the table(s) created earlier.
/* Explicit statement of result type as JSON 'ARRAY' */

SELECT edata.Combine(NEW JSON('[1,2,[3,4]]'), 'ARRAY') FROM my_table WHERE eno=3;

Result: The result is an array of several elements, with the last element an array itself.

edata.Combine(edata2)
[1,2,3,1,2,[3,4]]