Your answer is exreemely helpfull and i came to know i had not given enough information to resolve my problem.
select empno, ename, mgr, level
2 from emp
3 start with empno = 7788
4 connect by prior mgr = empno;
The above will work if it is one table and will work under one context (includes joins)
Now situation is,
In my scenario EMP table is Master table but prior mgr ID exist in Table B and Table C
I want a hierarcal query if it found in table b or Table c system should continue otherwise it should halt. One intresting point is I have to make nearly four or five joines to conclude data exist in Table B similary to conclude on Table C.
Table B and Table C data are two different contexts with single transaction table.
Main Topics
Browse All Topics





by: sujith80Posted on 2009-01-15 at 17:45:08ID: 23389773
You can use the hierarchical queries in Oracle. Which allows your to traverse the dependency chain.
See the example below. WHere it traverse through the chain of managers of an employee until the ultimate row.
Select allOpen in new window