Home » Developer & Programmer » JDeveloper, Java & XML » PARSE XML (Oracle 10 g ,windows)
PARSE XML [message #343161] Tue, 26 August 2008 08:51 Go to next message
manickam
Messages: 9
Registered: June 2005
Location: chennai
Junior Member

Hi all,

We are in the process of migrating the database from sql server to oracle.

We face certain blocks while converting the stored procedure from tsql(sqlserver) to plsql(oracle).

sql server, in a procedure we accept the input as a XML and parse it and split it and then put those data inside a table.

Now we are supposed to do the same in PLSQL, so help me out to achieve it. below i given an example , so what is the proper query to acheive it.


Let us consider our destination table as

create table project (projid int,empid int,department int,sal int)

The input XML is

<Project ProjID="P002">
<Employee EmplID="1001">
<Department>10</Department>
<Sal>1000</Sal>
</Employee>
<Employee EmplID="1002">
<Department>20</Department>
<Sal>2000</Sal>
</Employee>
</Project>


after inserting this xml the project table should hold

projid empid department sal
002 1001 10 1000
002 1002 20 2000


WHAT IS THE QUERY?
Re: PARSE XML [message #343192 is a reply to message #343161] Tue, 26 August 2008 10:18 Go to previous message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Search in the "JDeveloper, Java & XML" forum there are many examples.
Keywords: xmlelement, extractvalue, xmlsequence.

Regards
Michel
Previous Topic: Passing xml string to PL/SQL from JSP
Next Topic: guideline for making database design from xsd
Goto Forum:
  


Current Time: Fri Mar 29 05:21:58 CDT 2024