troubleshooting Question

Oracle XML Hierarchical output.

Avatar of nssudha
nssudha asked on
Oracle Database
24 Comments1 Solution1005 ViewsLast Modified:

I need to create a hieararchical XML from oracle table data, For Example: EMP. In my actual scenario, the entire data is coming from a view. In the EMP case, it is coming from Employee table.

Please find attached the sample xml output file. I masked my original data and may not look like a typical XML file. Basically, I need to group all the employees under one department and subgroup them under one MGR. I was able to generate the XML without the grouping. For example if there are 3 employees under deptno 10 and MGR 7839. Deptno 10 and MGR 7839 are also repeated for each employee.

Please help me with the query to generate the xml.

Thanks in advance.

Sudhkaar Naraparaju.
Join our community to see this answer!
Unlock 1 Answer and 24 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 24 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros