Export Data to an XML File in Oracle

Q

How To Export Data to an XML File in Oracle?

✍: FYIcenter.com

A

If you want to export data from a table to a file in XML format, you can use the following steps:

  • Right-click the table name, EMPLOYEES, in the object tree view.
  • Select Export.
  • Select XML. The Export Data window shows up.
  • Click Format tab.
  • Select Format as: XML.
  • Enter File as: \temp\MyTeam.xml.
  • Click Columns tab.
  • Check columns: FIRST_NAME, LAST_NAME, MANAGER_ID
  • Click Where tab.
  • Enter Where clause as: MANAGER_ID=100.
  • Click Apply.

Your XML file, \temp\MyTeam.xml, is ready. Open it, you will see:

<?xml version='1.0'  encoding='Cp1252' ?>
<results>
  <row>
    <FIRST_NAME><![CDATA[Gerald]]></FIRST_NAME>
    <LAST_NAME><![CDATA[Cambrault]]></LAST_NAME>
    <MANAGER_ID><![CDATA[100]]></MANAGER_ID>
  </row>
  <row>
    <FIRST_NAME><![CDATA[Lex]]></FIRST_NAME>
    <LAST_NAME><![CDATA[De Haan]]></LAST_NAME>
    <MANAGER_ID><![CDATA[100]]></MANAGER_ID>
  </row>
</results>

 

Create a Stored Procedure Interactively in Oracle

Export Data to a CSV File in Oracle

Introduction to Oracle SQL Developer

⇑⇑ Oracle Database Tutorials

2019-01-12, 1970🔥, 0💬