skip to Main Content

Parsing JSON with Oracle SQL without knowing incoming field names

I need to parse JSON using Oracle SQL select. Here is my JSON: {"result":[ { "field_name1":{"display_value":"TEST1","link":"https://test1.com","value":"abcd"}, "field_name2":{"display_value":"","link":"","value":""}, "field_name3":{"display_value":"TEST3","link":"https://test3.com","value":"efgh"}, "field_name4":{"display_value":"TEST4","link":"https://test3.com","value":"ijkl"} } ]} I want to get results as follows: field_name1:abcd field_name3:efgh field_name4:ijkl excluding those that have nulls in the value. How…

VIEW QUESTION

Oralce JSON_TRANSFORM, set/insert/append not working

Why this: with j(jval) AS ( select JSON_SERIALIZE('{"contract" :{"contract-type" : "P", "contract-id" : 123451, "proposal-no" : "123456", "serial-no" : "serialasd922", "product-code" : "s093", "contract-sign-dt" : "2016-12-01T00:00:00", "contract-start-dt" : "2016-12-09T00:00:00" } }' pretty) from dual ) SELECT json_transform(jval, insert '$.contract[*].x' =…

VIEW QUESTION

JSON_TABLE()-Function in Oracle's SQL

I'm currently struggling to import my API-Response to my Oracle table. I'm using the JSON_TABLE() but this function is not working as expected. I have a JSON value like this: { "CAR-1": [ { "state": "waiting", "timestamp": 1720476000 } ],…

VIEW QUESTION
Back To Top
Search