Home arrow Oracle arrow Page 4 - Loading and Unloading XML Files Using Oracle 10G XE

Importing a simplified, contrived XML file - Oracle

In many cases, exporting a table to create an XML file is easy, but importing an XML file to create a table is much more difficult. This is true for Oracle 10G XE, as you will see in this article.

TABLE OF CONTENTS:
  1. Loading and Unloading XML Files Using Oracle 10G XE
  2. From Table to XML
  3. Importing an XML File into Oracle 10G XE
  4. Importing a simplified, contrived XML file
By: Jayaram Krishnaswamy
Rating: starstarstarstarstar / 6
December 20, 2006

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

The steps involved in importing are very similar to exporting, so we will pick up at the point where you are ready to import an XML as shown in the next picture.

Here we need to take a break, because we do not have a table into which this XML file can be imported. For XML data such as that shown above, how do we construct a table? We attempt to create a table named 'ARGENTINA' in Oracle 10G XE using the following script. We can test and verify in the SQL utility available.

When you try to export this table to an XML file you will see that, unless the table is populated, you cannot export the table.

The next picture shows an exported file after creating a row in the table.

Now we want to create an XML file and then load it into the ARGENTINA table in the HR database.

Here is the XML file used for this purpose. Only the CustomerID and KeyVal have been altered.

Now when you click on the Load button you will get the following message stating that the load succeeded.

Now you can see in the object Browser the contents of the ARGENTINA table as shown in the next picture.

Summary

Importing XML data into Oracle 10G XE is not as easy as exporting a table to XML formatted data. This same type of difficulty was experienced while importing XML into MS Access 2003. The error messages when importing fails provided by Oracle 10G XE are not very useful as they do not provide any clue. The reason for this difficulty in the case of Oracle appears to be related to the non-standard way XML data may be authored. When one follows the rules to produce Canonical XML the import is easy.



 
 
>>> More Oracle Articles          >>> More By Jayaram Krishnaswamy
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

ORACLE ARTICLES

- Oracle Java Security Woes Continue
- Oracle's New IaaS Cloud Option: There's a Ca...
- Oracle Acquires Eloqua to Boost Cloud Presen...
- Choosing Innovation: Oracle Survey Insights
- Oracle Fixes Privilege Escalation Bug
- Oracle`s Communications Service Availability...
- Oracle Releases Exalytics, Taleo Plans
- Oracle Releases Communications Network Integ...
- Oracle Releases Communications Data Model 11...
- Oracle Releases PeopleSoft PeopleTools 8.52
- Oracle Integrates Cloudera Apache Distro, My...
- Oracle Releases MySQL 5.5.18
- Oracle Announces NoSQL Database Availability
- Sorting Database Columns With the SELECT Sta...
- Retrieving Table Data with the LIKE Operator

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: