Home » SQL & PL/SQL » SQL & PL/SQL » connect by root oracle 8
connect by root oracle 8 [message #188419] Fri, 18 August 2006 08:32 Go to next message
Messages: 1
Registered: August 2006
Junior Member

my table structures


I would like to obtain a hierarchical query that gives me for some parent (of type x start with parenttype=X),all children (of type y where childtype = Y) whatever level in the descending tree

by indicating in each line the parent root,the child and the level

the direct parent of the child doesn 't interest me

parent root1,child 11 level1
parent root1,child 12 level1
parent root1,child 31 level2
parent root1,child 47 level3

parent root2,child 12 level1
parent root2,child 18 level2 ....

how to do in oracle 8?
Re: connect by root oracle 8 [message #188515 is a reply to message #188419] Sat, 19 August 2006 00:15 Go to previous message
Messages: 3727
Registered: October 2005
Location: Melbourne, Australia
Senior Member
Hmmm. I've been having a ponder on this, and I've come up empty. Pre-10g you could use SYS_CONNECT_BY_PATH, but its only available from 9i onwards.

You might have to do it in PL/SQL unless someone has a clever idea.

If the tree is a fixed or limited depth, you could do it with repeated outer joins....


Ross Leishman
Previous Topic: how I use Arbic oracle database , form and report
Next Topic: Out Parameter
Goto Forum:

Current Time: Mon Jul 24 02:21:11 CDT 2017

Total time taken to generate the page: 0.71359 seconds