Setting Up the JSON Dot Notation 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 test.jsonTable(id INTEGER, jsonCol JSON(100));
CREATE TABLE test.jsonTable2(id INTEGER, jsonCol JSON(100));
CREATE TABLE test.jsonTable3(id INTEGER, jsonLatCol JSON(100) CHARACTER SET LATIN);

INSERT INTO test.jsonTable(1, new JSON('{"name" : "Cameron", "numbers" : [1,2,3,[1,2]]}'));
INSERT INTO test.jsonTable(2, new JSON('{"name" : "Cameron", "name" : "Lewis"}'));
INSERT INTO test.jsonTable(3,new JSON('{"name" : {"first" : "Cameron", "last" : "Lewis"}}'));

INSERT INTO test.jsonTable2(1, new JSON('{"name" : "Cameron", "numbers" : [1,2,3,[1,2]], "source" : "jsonTable2"}'));

INSERT INTO test.jsonTable3(1, new JSON('{"name" : "Cameron", "numbers" : [1,2,3,[1,2]], "source" : "jsonTable3"}'));