Example: USING QUOTES ('Y')
In this example, JSON_KEYS is invoked with the USING QUOTES ('Y') clause; therefore, the key names returned in the result are enclosed in double quotation marks.
SELECT * FROM JSON_KEYS (ON (SELECT NEW JSON('{ "x":{"a":{"b":3}} , "y" : "b"}')) USING QUOTES('Y')) AS json_data;
Result:
KEYS ---- "x" "x"."a" "x"."a"."b" "y"
Example: USING QUOTES ('N')
In this example, JSON_KEYS is invoked with the USING QUOTES ('N') clause; therefore, the key names returned in the result are not enclosed in double quotation marks.
SELECT * FROM JSON_KEYS (ON (SELECT NEW JSON('{ "x":{"a":{"b":3}} , "y" : "b"}')) USING QUOTES('N')) AS json_data;
Result:
KEYS ---- x x.a x.a.b y
Example: USING QUOTES Is Not Specified
In this example, JSON_KEYS is invoked without specifying the USING QUOTES clause. The default behavior is to return the key names enclosed in double quotation marks.
SELECT * FROM JSON_KEYS (ON (SELECT NEW JSON('{ "x":{"a":{"b":3}} , "y" : "b"}'))) AS json_data;
Result:
KEYS ---- "x" "x"."a" "x"."a"."b" "y"