OE.DEPTVIEW (view)

From dbscript Online Help
Revision as of 10:34, 27 August 2011 by Bot (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

wikibot[edit]

View OE.DEPTVIEW

Source[edit]

CREATE OR REPLACE VIEW OE.DEPTVIEW AS 
SELECT xmlelement("Department", xmlForest(department_name, location_id),
       (SELECT sys_xmlagg(xmlelement("Employee",xmlForest(last_name,
                                                           job_id,manager_id,
                                                           hire_date,
                                                           salary,
                                                           commission_pct)
                                    ), xmlformat('EmployeeList'))
        FROM employees e WHERE e.department_id = d.department_id
       )) xml
FROM departments d