例: 結果タイプがJSON ARRAYの明示的な文 - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - JSONデータ型

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
2021年7月
ft:locale
ja-JP
ft:lastEdition
2021-09-23
dita:mapPath
ja-JP/uwa1591040057999.ditamap
dita:ditavalPath
ja-JP/wrg1590696035526.ditaval
dita:id
evi1472243742653
Product Category
Software
Teradata Vantage
次の例では、JSON結合メソッドと'ARRAY'パラメータを併用して、結果をJSON配列に明示的に設定する方法を示します。
例では、以前に作成したテーブルを使用します。
/* Explicit statement of result type as JSON ARRAY */

SELECT MA.edata2.Combine(MB.edata2, 'ARRAY') 
FROM my_table AS MA, my_table2 AS MB
WHERE MA.eno < 3;

結果: 'ARRAY'パラメータを使用した結果はJSON配列です。

edata2.Combine(edata2)
----------------------
[{"name" : "Lewis"},{"name" : "Lewis"}]
[{"name" : "Lewis"},{"name" : "Lewis"}]
[{"name" : "Lewis"},{"name" : "Lewis"}]
[{"name" : "Lewis"},{"name" : "Lewis"}]