JSONExtractValueの例の設定 - Teradata Database - Teradata Vantage NewSQL Engine - JSONオブジェクトとINTEGERデータを含むテーブルを作成し入力します。以降のセクションの例では、このテーブルとデータを参照します。

Teradata Vantage™ JSONデータ型

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
2019年3月
Language
日本語
Last Update
2019-10-29
dita:mapPath
ja-JP/bgi1512081870828.ditamap
dita:ditavalPath
ja-JP/bgi1512081870828.ditaval
dita:id
evi1472243742653
Product Category
Software
Teradata Vantage

後の例で使用するテーブルを作成して、データを取り込みます。

CREATE TABLE my_table (eno INTEGER, edata JSON(1000));

INSERT INTO my_table (1, NEW JSON('[{"firstName" : "Cameron", "lastName" : "Lewis", "age" : 24, "schools" : [ {"name" : "Lake", "type" : "elementary"}, {"name" : "Madison", "type" : "middle"}, {"name" : "Rancho", "type" : "high"}, {"name" : "UCI", "type" : "college"} ], "job" : "programmer" }]'));

INSERT INTO my_table (2, NEW JSON('[{"firstName" : "Melissa", "lastName" : "Lewis", "age" : 23, "schools" : [ {"name" : "Lake", "type" : "elementary"}, {"name" : "Madison", "type" : "middle"}, {"name" : "Rancho", "type" : "high"}, {"name" : "Mira Costa", "type" : "college"} ] }]')); 

INSERT INTO my_table (3, NEW JSON('[{"firstName" : "Alex", "lastName" : "Smoley", "age" : 25, "schools" : [ {"name" : "Lake", "type" : "elementary"}, {"name" : "Madison", "type" : "middle"}, {"name" : "Rancho", "type" : "high"}, {"name" : "CSUSM", "type" : "college"} ], "job" : "CPA" }]'));

INSERT INTO my_table (4, NEW JSON('[{"firstName" : "David", "lastName" : "Perpich", "age" : 25, "schools" : [ {"name" : "Lake", "type" : "elementary"}, {"name" : "Madison", "type" : "middle"}, {"name" : "Rancho", "type" : "high"} ], "job" : "small business owner"}]'));