Human Resources and ELM - PSFT (MOSC)

MOSC Banner

Query to List out ALL Departments based on a user's Row Security.

edited Mar 30, 2022 3:32PM in Human Resources and ELM - PSFT (MOSC) 7 commentsAnswered ✓
The query below gives me the children departments for parent:  566416.  How do I modify the query to include the grandchildren, great grandchildren, etc.  I'm using WIN SQL and am not a Developer.

select Distinct A.setid, A.effdt as TreeDt, A.Parent_Node_Name as Parent, A.Tree_Level_Num as Lvl, A.tree_node as Child, C.DESCR as DeptNAME

from PSTREENODE A, PS_DEPT_TBL C

where A.Tree_node = C.DeptID

and A.EffDt = (select Max(B.EffDt) from PSTREENODE B WHERE A.Tree_Node = B.Tree_Node)

and C.Descr = (select Max(D.Descr) from PS_DEPT_TBL D where C.DeptID = D.DEPTId)

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center