Difference between revisions of "OE.DEPTVIEW (view)"
(New page: == wikibot == {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" |- | '''view | OE.DEPTVIEW |- |} <pre> </pre>) |
|||
Line 7: | Line 7: | ||
|- | |- | ||
|} | |} | ||
+ | |||
<pre> | <pre> | ||
− | + | CREATE OR REPLACE 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 | ||
</pre> | </pre> |
Revision as of 20:02, 24 August 2009
wikibot
view | OE.DEPTVIEW |
CREATE OR REPLACE 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