|
| Oracle to XML and back? |
 |
Mon, 31 Mar 2008 17:36:37 +000 |
I need to expose an XML schema for our client. They want to create XML files,
which we will parse and insert into the database as real records.
For example:
If I have the following Table Structure (ignoring the invalid syntax):
create table tbparents(
parent_id number primary key,
description varchar2(30));
create table tbchildren(
child_id number primary key,
parent_id number references tbparents.parent_id,
description varchar2(30));
I would want to create something like the following:
<parent>
<description>Foo</description>
<children>
<child>
<description>bar</description>
</child>
<child>
<description>baz</description>
</child>
<children>
<parent>
Does anyone know of any tools which can create an XML schema and XML data files
from an Oracle schema? It would also need to be able to take an xml data file
with this structure, and create a set of insert statements, using sequences, and
not be tied to existing ID.
For example, the above XML structure should create something like:
declare
vparent_id number;
begin
select seq_tbparents.nextval
into vparent_id
from dual;
insert into tbparents (parent_id, description)
values (vparent_id, 'foo');
insert into tbchildren (child_id, parent_id, description)
values (seq_tbchildren.nextval, vparent_id, 'bar');
insert into tbchildren (child_id, parent_id, description)
values (seq_tbchildren.nextval, vparent_id, 'baz');
commit;
end;
/
Does such software exist? It is fairly straight forward to write something like
this, but I want to save the time if there was something we could just buy.
|
| Post Reply
|
| Re: Oracle to XML and back? |
 |
Tue, 1 Apr 2008 11:06:33 +0000 |
Instead of buying a tool, u can do it manually very easily. Refer: -
http://www.orafaq.com/faqxml.htm
Please click Mark As Answer if this helped in solving your problem.
|
| Post Reply
|
|
|
|
|
|
|
|
|
|