Example: Use JSON_KEYS to Get Key Names with No Depth Specified - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905
The example uses JSON_KEYS to get the key names of a JSON object. No depth is specified, so the entire depth is searched and the keys at all levels are returned.
SELECT * from JSON_KEYS
(
ON (SELECT json_data FROM json_table))
AS json_data;
Result:
KEYS
----
“coord”
“coord”.”lon”
“coord”.”lat”
“sys”
“sys”.”country”
“sys”.”sunrise”
“sys”.”sunset”
“weather”
“weather”[0].”id”
“weather”[0].”main”
“weather”[0].”description”
“weather”[0].”icon”
“base”
“main”
“main”.”temp”
“main”.”humidity”
“main”.”pressure”
“main”.”temp_min”
“main”.”temp_max”
“wind”
“wind”.”speed”
“wind”.”deg”
“clouds”
“clouds”.”all”
“dt”
“id”
“name”
“cod”