Skip to Main Content

SQL & PL/SQL

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!

XML root elements

653816Nov 10 2008 — edited Nov 11 2008
Hi i am writing a sql select query to create an xml file.

SELECT

XMLELEMENT("data",
XMLATTRIBUTES('http://smile.mit.edu/shelf/' as "wiki-url",
'SIMILE JFK Timeline' as "wiki-section"),
XMLELEMENT("event",
XMLATTRIBUTES(e.IMP_DATE as "start",
e.NAME||': '|| e.ECCTS as "title",
e.IMP_DATE as "end")
))
from monica_tab2 e;

When this query runs, it appears to show the data tags as elements for every record. I want this to be a root element so that it only appear once for all the events.

Is there any way i can do this? Examples will be appreciated
Thanks

Edited by: Monica B on Nov 10, 2008 7:21 AM
This post has been answered by BluShadow on Nov 10 2008
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 9 2008
Added on Nov 10 2008
5 comments
543 views