SELECT E.OPRID , C.BUDGET_PERIOD , B.BUSINESS_UNIT , A.EMPLID , A.LANGUAGE_CD , A.NAME_DISPLAY FROM PSOPRDEFN E , PS_NAMES_LNG A , PS_JOB B , PS_BUDGET_PERIOD C , PS_BUDGET_BUS_UNIT D WHERE A.EMPLID = B.EMPLID AND A.NAME_TYPE = 'PRI' AND %EffdtCheck(NAMES_LNG, A, %CurrentDateIn) AND D.BUSINESS_UNIT=B.BUSINESS_UNIT AND D.BUDGET_PERIOD=C.BUDGET_PERIOD AND B.EFFDT = ( SELECT MAX(D.EFFDT) FROM PS_JOB D WHERE D.EMPLID = B.EMPLID AND D.EMPL_RCD = B.EMPL_RCD AND D.EFFDT <= C.THRU_DATE) AND B.EFFSEQ = ( SELECT MAX(EFFSEQ) FROM PS_JOB WHERE EMPLID = B.EMPLID AND EMPL_RCD = B.EMPL_RCD AND EFFDT = B.EFFDT) AND B.JOB_INDICATOR = 'P'
|