SELECT OFR.HRS_OFF_ID , OFR.HRS_PERSON_ID , OFR.HRS_RCMNT_ID , JCL.LANGUAGE_CD , JCL.DESCR , BU.DESCR , COALESCE(( SELECT NML.NAME_DISPLAY FROM PS_HRS_PERSON_NM_L NML WHERE NML.EMPLID = OFR.HRS_HIRING_MGR_ID AND NML.LANGUAGE_CD = JCL.LANGUAGE_CD),( SELECT NM.NAME_DISPLAY FROM PS_HRS_PERSON_NM_I NM WHERE NM.EMPLID = OFR.HRS_HIRING_MGR_ID )) , COALESCE(( SELECT NML.NAME_DISPLAY FROM PS_HRS_PERSON_NM_L NML WHERE NML.EMPLID = OFR.RECRUITER_ID AND NML.LANGUAGE_CD = JCL.LANGUAGE_CD),( SELECT NM.NAME_DISPLAY FROM PS_HRS_PERSON_NM_I NM WHERE NM.EMPLID = OFR.RECRUITER_ID )) ,COALESCE(( SELECT NML.NAME_DISPLAY FROM PS_HRS_APP_NM_LNG NML WHERE NML.HRS_PERSON_ID = OFR.HRS_PERSON_ID AND NML.LANGUAGE_CD = JCL.LANGUAGE_CD),( SELECT NM.NAME_DISPLAY FROM PS_HRS_APP_NAMES NM WHERE NM.HRS_PERSON_ID = OFR.HRS_PERSON_ID)) FROM PS_HRS_OFFER OFR , PS_HRS_RCMNT RCM , PS_JOBCODE_TBL JCD , PS_JOBCODE_LANG JCL , PS_BUS_UNIT_HR_LNG BU WHERE RCM.HRS_PERSON_ID = OFR.HRS_PERSON_ID AND RCM.HRS_RCMNT_ID = OFR.HRS_RCMNT_ID AND JCD.SETID = ( SELECT SCR.SETID FROM PS_SET_CNTRL_REC SCR WHERE SCR.SETCNTRLVALUE = OFR.BUSINESS_UNIT AND RECNAME = 'JOBCODE_TBL') AND JCD.JOBCODE = OFR.JOBCODE AND JCD.EFFDT = ( SELECT MAX(JCD2.EFFDT) FROM PS_JOBCODE_TBL JCD2 WHERE JCD2.SETID = JCD.SETID AND JCD2.JOBCODE = JCD.JOBCODE AND JCD2.EFFDT <= %CurrentDateIn) AND JCD.EFF_STATUS = 'A' AND JCL.SETID = JCD.SETID AND JCL.JOBCODE = JCD.JOBCODE AND JCL.EFFDT = JCD.EFFDT AND BU.BUSINESS_UNIT = OFR.BUSINESS_UNIT AND BU.LANGUAGE_CD = JCL.LANGUAGE_CD
|