Hierarchical Queries [message #483199] |
Fri, 19 November 2010 03:00  |
Nshan
Messages: 62 Registered: February 2009
|
Member |
|
|
Hi All,
My requirement is as follows,
We are sending notifications to requestors.
If requestor email address is null/inactive then notification should goto requetor's manager
If requetor's manager email address is null/inactive then notification should goto requetor's manager's manager
i.e Search should go up in the hierarchy till it finds a active manager
For ex:
NVL(requestor_email, req_managers_email)
I am taking email address from the per_people_f and supervisor details from per_assignments_v7 view.
Could anyone please help me on this query part.
Thanks,
Nirmala S
|
|
|
Re: Hierarchical Queries [message #483558 is a reply to message #483199] |
Mon, 22 November 2010 22:53  |
 |
vamsi kasina
Messages: 2112 Registered: October 2003 Location: Cincinnati, OH
|
Senior Member |
|
|
I think you can use connect by prior.
You can tweak SYS_CONNECT_BY_PATH, so that you can get the first not null.
(Or) simple order by of level and not null filter would suffice.
By
Vamsi
|
|
|