JSONExtract[Large]Value Method Examples | Teradata Vantage - Setting Up the JSONExtractValue and JSONExtractLargeValue Examples - 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ā„¢

Create and populate table(s) to use in subsequent example(s).

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"}]'));