StuffHappens
StuffHappens

Reputation: 6557

Parse xml with one to many relationship in Oracle

I have a lot of xml files (and xsd file for them) and a need to save their content parsed in Oracle tables. The xml files have one-to-many relationship.

Here's an example of such file:

<Customer>
    <FirstName>Tom</FirstName>
    <LastName>Smith</LastName>
    <Address>
        <City>NY</City>
        <Street>1st Avenue</Street>
    </Address>
    <Address>
        <City>NY</City>
        <Street>2st Avenue</Street>
    </Address>
    <Phone>123456</Phone>
    <Phone>345</Phone>
    <Phone>768567</Phone>
    <Phone>345345</Phone>
</Customer>

The real files are around 1000 lines long each, the example is simplified. How do I parse these files in oracle without writing much code? Tables are not created yet so I would like also to know how to create them based on xsd.

Upvotes: 0

Views: 124

Answers (1)

davmos
davmos

Reputation: 9577

Plenty of thoughts on this in these past questions:

How can I create database tables from XSD files?

Convert XSD into SQL relational tables

Although XMLSpy is not free, you can get a fully-functional 30-day trial for free at altova.com/download-trial

Upvotes: 1

Related Questions