Siebel SQLs/Error Messages >  Find Position hierarchy of a position

 

---To suppress '&' characters in strings to hang SQL developer
-- (prompt for a variable) run: SET DEFINE OFF;
-- this gives you the parent position , division or child position one level
deep

 

SET DEFINE OFF;
SELECT X.NAME "Division", A.NAME "POSITION",
A.ROW_ID "Position Row_ID", C.ROW_ID "Parent Position Row_ID", C.NAME "PARENT POSITION"
FROM
S_POSTN A, S_PARTY B, S_POSTN C, S_ORG_EXT X
WHERE
C.ROW_ID (+) = B.PAR_PARTY_ID
AND A.PAR_ROW_ID = B.ROW_ID
AND A.OU_ID = X.ROW_ID
and c.row_id ='position row id';