15.10 - Setting Up the JSON_TABLE Examples - Teradata Database

Teradata Database Teradata JSON

Product
Teradata Database
Release Number
15.10
Published
December 2015
Language
English (United States)
Last Update
2018-06-05
dita:mapPath
TeradataJSON_15_10.ditamap
dita:ditavalPath
ft:empty

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

CREATE TABLE my_table (id INTEGER, jsonCol JSON(1000));
INSERT INTO my_table (1, NEW JSON('{"name" : "Cameron", "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('{"name" : "Melissa", "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('{"name" : "Alex", "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('{"name" : "David", "age" : 25, 
"schools" : [ {"name" : "Lake", "type" : "elementary"}, 
{"name" : "Madison", "type" : "middle"}, 
{"name" : "Rancho", "type" : "high"} ], 
"job" : "small business owner"}'));