SELECT APP.HRS_PERSON_ID , APP.HRS_PROFILE_SEQ , RCMNT.HRS_RCMNT_ID , 0 , JOFAM.JOB_FAMILY , 0 , '0' FROM PS_HRS_APP_PROFILE APP , PS_HRS_RCMNT RCMNT , PS_HRS_APP_JOBFAM JOFAM WHERE APP.HRS_PERSON_ID = RCMNT.HRS_PERSON_ID AND APP.HRS_PROFILE_SEQ = RCMNT.HRS_PROFILE_SEQ AND APP.HRS_PERSON_ID = JOFAM.HRS_PERSON_ID AND APP.HRS_PROFILE_SEQ = JOFAM.HRS_PROFILE_SEQ AND JOFAM.JOB_FAMILY <> ' ' UNION ALL SELECT APP.HRS_PERSON_ID , APP.HRS_PROFILE_SEQ , RCMNT.HRS_RCMNT_ID , JO.HRS_JOB_OPENING_ID , JO.JOB_FAMILY , 0 , %Cast(JO.HRS_JOB_OPENING_ID, number, character) FROM PS_HRS_APP_PROFILE APP , PS_HRS_RCMNT RCMNT , PS_HRS_JOB_OPENING JO WHERE APP.HRS_PERSON_ID = RCMNT.HRS_PERSON_ID AND APP.HRS_PROFILE_SEQ = RCMNT.HRS_PROFILE_SEQ AND RCMNT.HRS_JOB_OPENING_ID = JO.HRS_JOB_OPENING_ID AND JO.JOB_FAMILY <> ' ' UNION ALL SELECT APP.HRS_PERSON_ID , APP.HRS_PROFILE_SEQ , RCMNT.HRS_RCMNT_ID , 0 , ' ' ,APP.HRS_DES_LOC1 , '0' FROM PS_HRS_APP_PROFILE APP , PS_HRS_RCMNT RCMNT WHERE APP.HRS_PERSON_ID = RCMNT.HRS_PERSON_ID AND APP.HRS_PROFILE_SEQ = RCMNT.HRS_PROFILE_SEQ AND APP.HRS_DES_LOC1 > 0 UNION ALL SELECT APP.HRS_PERSON_ID , APP.HRS_PROFILE_SEQ , RCMNT.HRS_RCMNT_ID , 0 , ' ' ,APP.HRS_DES_LOC2 , '0' FROM PS_HRS_APP_PROFILE APP , PS_HRS_RCMNT RCMNT WHERE APP.HRS_PERSON_ID = RCMNT.HRS_PERSON_ID AND APP.HRS_PROFILE_SEQ = RCMNT.HRS_PROFILE_SEQ AND APP.HRS_DES_LOC2 > 0 UNION SELECT RCMNT.HRS_PERSON_ID , RCMNT.HRS_PROFILE_SEQ , 0 , 0 , ' ' , 0 , 'ALL' FROM PS_HRS_RCMNT RCMNT
|