Hi,
I have the following XML data that I need to convert to table.
<ExportXML>
\<record>
\<field name="ProfileInformation,Candidate,Number">67264\</field>
\<field name="Staff\_SIAAmount,Code">10,000\</field>
\</record>
\<record>
\<field name="ProfileInformation,Candidate,Number">51301\</field>
\<field name="Staff\_SIAAmount,Code">10,000\</field>
\</record>
</ExportXML>
I have this script that I created based on my research online however it does not produce the desired results.
select *
from xmltable ('/ExportXML/record/field' passing XMLType.createXML('<ExportXML>
\<record>
\<field name="ProfileInformation,Candidate,Number">67264\</field>
\<field name="Staff\_SIAAmount,Code">10,000\</field>
\</record>
\<record>
\<field name="ProfileInformation,Candidate,Number">51301\</field>
\<field name="Staff\_SIAAmount,Code">10,000\</field>
\</record>
\</ExportXML>') columns attribute varchar2(250) path '@name'
, value varchar2(100) path '.' );
The screenshot below is the current output.
![2017-10-30 10_09_58-APPS@HRDEV - SQLTools 1.8b38 - [Script 2 _].png](https://objectstorage.us-phoenix-1.oraclecloud.com/p/BqK85Rn1zA5MP0vYiqbAdPgs7Z6OmMxw8SD3WCFVm5kY8uReidZ1KPIKkgJ1hCkG/n/axciphqpnohg/b/forums-legacy/o/uploads/jive_attachments/0/1/9/01984454egami.png)
The screen shot below is the desired output which is what I'm trying to achieve.
![2017-10-30 10_11_21-APPS@HRDEV - SQLTools 1.8b38 - [Script 2 _].png](https://objectstorage.us-phoenix-1.oraclecloud.com/p/BqK85Rn1zA5MP0vYiqbAdPgs7Z6OmMxw8SD3WCFVm5kY8uReidZ1KPIKkgJ1hCkG/n/axciphqpnohg/b/forums-legacy/o/uploads/jive_attachments/1/1/9/11984454egami.png)
Appreciate any help.