Example: Use JSON_Keys to Obtain Key Names with No Depth Specified

Teradata Vantage™ JSON Data Type

brand
Software
Teradata Vantage
prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1150-162K
The example uses JSON_KEYS to obtain 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”