Skip to Content
0
Jan 26, 2023 at 08:52 PM

Is it possible to loop through a JSON element in SAP HANA?

201 Views

I have a requirement to parse through a JSON file in SAP HANA and the keys are not known. I have tried using JSON_QUERY() and JSON_VALUE() functions but without any help.

Is there any method to parse through it using indices? My JSON kind of looks like the following:

{"Name": "XYZ", "Phone":000111222999, "Email": "mrxyz@gmail.com", "Education": {"Diploma": "Institute_1", "Graduation": "Institute_2", "Degree": "Degree_1"}}

How can I obtain the (key, value) pairs without knowing the keys and also the number of (key, value) pairs in total? If not possible, then what are my alternatives? Kindly help.