MySQL Forums
Forum List  »  Stored Procedures

procedure to insert data onto a table in db from an xml data
Posted by: Gayathri ChandraKumar
Date: July 21, 2014 11:19PM

Hi friends,

Here is an xml from which i should insert data onto a table in DB. I have to read the nodes, insert them to a temporary table and from there i should insert it to the DB table depending upon the status. There are two DB tables name TableA(parent) , TableB(child).

(P) - Parent Table , (C) - Child Table

<?xml version="1.0" encoding="utf-8"?>
<xml>
<item>
<process_id>36</process_id>(P)
<product_id>19</product_id>(P)
<duration>435</duration>(P)
<sequenceno>10</sequenceno>(P)
<processname>Process 1</processname>(P)
<cost/>(P)
<status>0</status>(P)
<materials>
<material>
<mattype>2</mattype>(C)
<product_id>19</product_id>(C)
<status>-1</status>(C)
</material>
<material>
<mattype>2</mattype>(C)
<product_id>19</product_id>(C)
<status>0</status>(C)
</material>
</materials>
</item>
<item>
<process_id>36</process_id>(P)
<product_id>19</product_id>(P)
<duration>5</duration>(P)
<sequenceno>20</sequenceno>(P)
<processname>Process 1</processname>(P)
<cost>6</cost>(P)
<status>0</status>(P)
<materials>
<material>
<mattype>2</mattype>(C)
<product_id>19</product_id>(C)
<status>0</status>(C)
</material>
</materials>
</item>
</xml>
I first need to know how to read the nodes??

Options: ReplyQuote


Subject
Views
Written By
Posted
procedure to insert data onto a table in db from an xml data
1770
July 21, 2014 11:19PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.