XmlSerialize - SqlDeveloper
989750Feb 7 2013 — edited Feb 8 2013Hi 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 :)