8i | 9i | 10g | 11g | 12c | 13c | 18c | 19c | Misc | PL/SQL | SQL | RAC | WebLogic | Linux

Home » Misc » Here

Comments for JSON_MERGEPATCH in Oracle Database 19c


GlenM said...

To modify the JSON Nested Object :
SELECT JSON_MERGEPATCH(a.data.parent1, '{"child2":99}')
AS data
FROM json_documents a
WHERE a.id = 5;

which can then be nested inside another :
SELECT JSON_MERGEPATCH(a.data,'{"parent1":'||
JSON_MERGEPATCH(a.data.parent1, '{"child2":99}')
||'}')
AS data
FROM json_documents a
WHERE a.id = 5;

A bit clunky - but better than nothing.

Glen

DO NOT ask technical questions here! They will be deleted!

These comments should relate to the contents of a specific article. Constructive criticism is good. Advertising and offensive comments are bad and will be deleted!

If you post personal information (name, email address etc.) you are agreeing to them being stored and displayed. Feel free to remain anonymous.