Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

XmlSerialize - SqlDeveloper

989750Feb 7 2013 — edited Feb 8 2013
Hi everyone! I have a file .xml stored in C:\ and i want to extract some tag from this file and insert them into a table as varchar/interger. I'm trying to use xmlserialize, but it doesn't work:

insert into categoria(nome) values (XMLSERIALIZE(DOCUMENT 'C:\file.xml\Name' AS varchar(30)));

The file.xml is something like this:

<?xml version="1.0" encoding="UTF-8"?>
<GolfCompetition xsi:noNamespaceSchemaLocation="GolfCompetition.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Name>Summer Cup</Name>
<Date>2010-05-24</Date>
<Sponsor>Yuppi Yuppi</Sponsor>
<Category NumPrize="2" From="0" To="12">First</Category>
</GolfCompetition>

And i want to obtain a table like that:

Category
-------------------------------------------------------
Name | Num_P | Min_H | Max_H
--------------------------------------------------------
Summer Cup | 2 | 0 | 12


An important thing is that i have to access the file directly like in my example. I'm using SQLDevelepor.

Thanks in advance for any help :)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 8 2013
Added on Feb 7 2013
7 comments
521 views