SELECT O.CLASSID , X.EMPLID , X.BUSINESS_UNIT_PC , X.PROJECT_ID , X.ACTIVITY_ID , C.LANGUAGE_CD , P.DESCR FROM PS_PERSON E , PS_PROJ_ACTIVITY P , PS_PROJ_ACTIVTY_LG C , PSCLASSDEFN O , PS_FO_EMPL_XREF X WHERE P.EFF_STATUS = 'A' AND %Join(COMMON_KEYS, PROJ_ACTIVITY P, PROJ_ACTIVTY_LG C) AND X.BUSINESS_UNIT_PC = P.BUSINESS_UNIT AND X.PROJECT_ID = P.PROJECT_ID AND X.ACTIVITY_ID = P.ACTIVITY_ID AND X.EMPLID = E.EMPLID AND ( P.ENFORCE IN ('N','E') OR EXISTS ( SELECT 'X' FROM PS_PC_ACT_TEAM_VW TEAM WHERE P.BUSINESS_UNIT = TEAM.BUSINESS_UNIT AND P.PROJECT_ID = TEAM.PROJECT_ID AND P.ACTIVITY_ID = TEAM.ACTIVITY_ID AND E.EMPLID = TEAM.TEAM_MEMBER ) ) AND ( (EXISTS ( SELECT 'X' FROM PS_TL_GRP_SECURITY S WHERE S.ROWSECCLASS = O.CLASSID) AND X.EMPLID IN ( SELECT F.EMPLID FROM PS_TL_GRP_SECURITY S , PS_TL_GROUP_DTL F WHERE S.TL_GROUP_ID = F.TL_GROUP_ID AND F.EMPLID = X.EMPLID AND F.EMPL_RCD = X.EMPL_RCD AND S.ROWSECCLASS = O.CLASSID )) OR (NOT EXISTS ( SELECT 'X' FROM PS_TL_GRP_SECURITY S WHERE S.ROWSECCLASS = O.CLASSID ) AND X.EMPLID IN ( SELECT PS.EMPLID FROM PS_PERS_SRCH_GBL PS WHERE X.EMPLID = PS.EMPLID AND X.EMPL_RCD = PS.EMPL_RCD AND PS.ROWSECCLASS = O.CLASSID) ) )
|