I have a real puzzle, I figured someone on here could help. I have a
table that tracks all parents and children. I would like to set
iterate over all entities where I set a variable to equal a root
parent and return all relations disregarding why the relation exists.
Essentially here is what I would like to do however, this won't work
for obvious reasons:
select parent, (select child from table
start with parent = (select parent from table)
connect by parent = prior child)
from table
so instead of
1,2
1,3
3,4
3,5
I need my result to be used in a view where
1,2
1,3
1,4
1,5
3,4
3,5
Anyone know of a way to do this? I know that I can use a cursor and
keep track of the root parent while using a cursor to track all
relations for the root parent and place that into a function, but this
will be constantly growing and I can't process this logic everytime
there is an update.
Thanks for any insight...
Ray
table that tracks all parents and children. I would like to set
iterate over all entities where I set a variable to equal a root
parent and return all relations disregarding why the relation exists.
Essentially here is what I would like to do however, this won't work
for obvious reasons:
select parent, (select child from table
start with parent = (select parent from table)
connect by parent = prior child)
from table
so instead of
1,2
1,3
3,4
3,5
I need my result to be used in a view where
1,2
1,3
1,4
1,5
3,4
3,5
Anyone know of a way to do this? I know that I can use a cursor and
keep track of the root parent while using a cursor to track all
relations for the root parent and place that into a function, but this
will be constantly growing and I can't process this logic everytime
there is an update.
Thanks for any insight...
Ray
Comment