Example: Combine Two JSON ARRAYs and Explicitly State the Result Is a JSON ARRAY - Advanced SQL Engine - Teradata Database

JSON Data Type

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
uwa1591040057999.ditamap
dita:ditavalPath
uwa1591040057999.ditaval
dita:id
B035-1150
lifecycle
previous
Product Category
Teradata Vantageā„¢

The following examples show how to use the JSON Combine method with the 'ARRAY' parameter to explicitly set the result to a JSON array.

The example specifies the 'ARRAY' parameter. Note, the data being combined are both JSON array instances, so 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(edata, 'ARRAY') FROM my_table WHERE eno=3;

Result: The result is an array of values.

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