469,337 Members | 6,013 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,337 developers. It's quick & easy.

Load Xml in oracle (SQL LOADER)

11
i have written a sql loader script given below....



load data
infile 'contact1.xml' "str '</CONTACT>'"
truncate

into table XmlTest
(
dummy filler terminated by ">",
Location_id enclosed by "<Location_id>" and "</Location_id>",
fname enclosed by "<fname>" and "</fname>",
lname enclosed by "<lname>" and "</lname>"
)


the content of the contact1.xml is given below.....
<CONTACT>
<Location_id>1</Location_id>
<fname>Robert</fname>
<lname>Jones</lname>
</CONTACT>
<CONTACT>
<Location_id>1</Location_id>
<fname>Robert</fname>
<lname>Jones</lname>
</CONTACT>



the script works fine for the given xml... but if one of the tag in the xml is changed to below syntax....
<CONTACT Location_id="1">
<fname>Robert</fname>
<lname>Jones</lname>
</CONTACT>
<CONTACT Location_id="1">
<fname>Robert</fname>
<lname>Jones</lname>
</CONTACT>

the script fails....
what modification is required in the script to read such xml...Kindly Help!!
Jun 4 '08 #1
0 3770

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by Adriano | last post: by
reply views Thread by san1014 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.