Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Return Nested XML from Heirarchical Query
I have the following hierarchical query that returns our company's
organizational structure:
SELECT TRIM(E.LAST_NAME)||', '||TRIM(E.NICK_NAME) AS Name,
J.DESCRIPTION AS Title
FROM LAWPRODHR.EMPLOYEE E
JOIN LAWPRODHR.JOBCODE J ON J.COMPANY = E.COMPANY AND J.JOB_CODE = E.JOB_CODE LEFT JOIN LAWPRODHR.HRSUPER S ON S.COMPANY = E.COMPANY AND S.EMPLOYEE = E.EMPLOYEE
For example, the executive branch of the U.S. Government would look like this:
<Position>
<Name>George Bush</Name> <Title>President</Title> <Position>
<Name>Gordon England</Name> <Title>Deputy Secretary of Defense</Title>
<Name>Karen Hughes</Name> <Title>Under Secretary for Public Diplomacy and PublicAffairs</Title>
</Position>
</Position>
</Position>
Received on Mon Jul 17 2006 - 12:19:08 CDT
![]() |
![]() |