I have some existing working PL/SQL code running in a 19c Oracle database that uses the dbms_xmlstore.insertxml(...) to insert data into a table. For this to work the XML is structured so that the element names match the table column names, so the XML looks something like this:
<ROWSET>
<ROW>
<EMPLOYEE_ID>920</EMPLOYEE_ID>
<SALARY>1800</SALARY>
</ROW>
<ROW>
<EMPLOYEE_ID>921</EMPLOYEE_ID>
<SALARY>2000</SALARY>
</ROW>
</ROWSET>
I now need to do something similar but with JSON data so is there an something equivalent that allows me to insert rows into a table directly from the JSON object or to to convert the JSON to XML and carry on with the present working code?
EDIT: The key part that I need to replicate is the way the insertxml() function takes the column names from the XML without me needing to supply them to the function.