Setting Up the JSON_Keys Examples - Teradata Vantage NewSQL Engine - 16.20

Teradata Vantageā„¢ JSON Data Type

prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1150-162K

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

CREATE TABLE json_table(
    id int,
	json_data JSON(32000)
);

INSERT json_table(1, '
{
    "coord": {
        "lon": 145.766663,
        "lat": -16.91667
    },
    "sys": {
        "country": "AU",
        "sunrise": 1375216946,
        "sunset": 1375257851
    },
    "weather": [
        {
            "id": 800,
            "main": "Clear",
            "description": "Sky is Clear",
            "icon": "01n"
        }
    ],
    "base": "global stations",
    "main": {
        "temp": 288.97,
        "humidity": 99,
        "pressure": 1007,
        "temp_min": 288.71,
        "temp_max": 289.15
    },
    "wind": {
        "speed": 5.35,
        "deg": 145.001
    },
    "clouds": {
        "all": 0
    },
    "dt": 1375292971,
    "id": 2172797,
    "name": "Cairns",
    "cod": 200
}
');

INSERT json_table(2, '
{
    "coord": {
        "lon": 245.766663,
        "lat": -16.91667
    },
    "sys": {
        "country": "US",
        "sunrise": 1375216946,
        "sunset": 1375257851
    },
    "weather": [
        {
            "id": 800,
            "main": "Clear",
            "description": "Sky is Cloudy",
            "icon": "01n"
        }
    ],
    "base": "global stations",
    "main": {
        "temp": 288.97,
        "humidity": 99,
        "pressure": 1007,
        "temp_min": 288.71,
        "temp_max": 289.15,
        "temp_scale" : "Fahrenheit"
    },
    "wind": {
        "speed": 5.35,
        "deg": 145.001
    },
    "clouds": {
        "all":0
    },
    "dt": 1375292971,
    "id": 2172797,
    "name": "Los Angeles",
    "cod": 200
}
');