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!

Adding more xml attributes (help with xmlElement and XMLForest)

Alistair LaingAug 4 2010 — edited Aug 11 2010
Hi

I have this bit of code
SELECT xmlagg(
 xmlelement("tr", xmlattributes(d.deptno as "dept"),
  xmlforest(
   e.ename as "td",
   d.dname as "td"
  )
 )
).getclobval()
FROM scott.emp e 
     JOIN scott.dept d ON d.deptno = e.deptno
WHERE e.deptno = 20
;
What would do I need to do to add another attribute to the TR xml element? for example if I wanted to add in the "JOB" to a custom attribute.

Edited by: Alistair Laing on Aug 4, 2010 11:38 AM
This post has been answered by BluShadow on Aug 4 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 8 2010
Added on Aug 4 2010
33 comments
6,531 views