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

Teradata Vantage™ - JSONデータ型

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
2020年9月
Language
日本語
Last Update
2021-03-30
dita:mapPath
ja-JP/gzn1554761068186.ditamap
dita:ditavalPath
ja-JP/gzn1554761068186.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"}]