A week or so ago, I blogged about wanting to implement a SQL Developer (f.k.a. Raptor) extension to render XMLType columns as XML. Kris Rice beat me to it, and even went the extra distance to provide a one-click install through the SQL Developer "Check for Updates..." feature. Nice work!
Try installing the extension and trying a query like this when logged on as SCOTT...
SELECT XMLElement("Departments", XMLAgg( XMLElement(NAME "Department", XMLAttributes(deptno as "id"), XMLForest (initCap(dname) AS "DepartmentName"), (SELECT XMLAgg( XMLElement("Employee", XMLAttributes(empno As "id"), XMLForest(initCap(ename) as "Name", sal as "Salary", initCap(job) as "Job") ) ) FROM emp e where e.deptno = d.deptno ) ) ) ) as result FROM dept d WHERE deptno = 10
1:08:45 AM
|
|