This content has been marked as final.
Show 1 reply
-
1. Re: parsing json response having jsonarr
rareddy Jul 5, 2016 3:44 PM (in response to dineshnasa)1 of 1 people found this helpfulYour JSON document is is wrong, not formatted correctly. Missing quotes around names, array closing, closing brace etc. Make sure that is correct. Once corrected a query like below
select test1, test2 from XMLTABLE('/response/response/docs' passing JSONTOXML('response', '{"response":{"docs":[{"test1":"SOME_VALUE1","test2":"SOME_VALUE2"},{"test1":"SOME_VALUE3","test2":"SOME_VALUE4"}]}}') COLUMNS test1 string path 'test1', test2 string path 'test2') as A
gives back
test1 test2 SOME_VALUE1 SOME_VALUE2 SOME_VALUE3 SOME_VALUE4