Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: hierarchical query without direct parent-child relationship
Hi,
thank you for your answer. Meanwhile I got a solution which uses a view
based on the elements
select p1.ELEMENT, p2.ELEMENT, p1.PROCESS
from PRODUCTELEMENTACCESSTRACE p1, PRODUCTELEMENTACCESSTRACE p2
where p1.PROCESS=p2.PROCESS
and p1.ACCESS='READ' and p2.ACCESS='CREATE'
The table looks like:
A->B B->C B->D
Ed Prochak schrieb:
> On Jun 1, 6:35 am, Roland Spatzenegger <c..._at_npg.net> wrote:
> here your hierarchy is based on the process ID >
> here your hierarchy is based on the element > > So that is why this query stops:
> > I don't think you can track two connections at once in CONNECT BY. > I think you are stuck with with either a table redesign or a PL/SQL > procedure. > > I was trying to think of how to make a view that would solve this, but > I cannot come up with one off hand. What do you end up with if you > run: > > select a.ELEMENT, a.PROCESS as CREATOR, b.PROCESS as READER > from PRODUCTELEMENTACCESS a, PRODUCTELEMENTACCESS b > where a.ACCESS='CREATE' > and b.ACCESS='READ' > and a.ELEMENT=b.ELEMENT ; > > and run the CONNECT BY on that as a view? I'm not sure how to handle > the "starting elements" such as 5004. Seems like there must be an > INITIAL process that CREATEs them. > > 5004 0001 CREATE >
Yes, there must be such an initial row, I've forgotten to insert it in my example.
bye
Roland
Received on Fri Jun 01 2007 - 14:43:11 CDT
![]() |
![]() |