I've exhausted my efforts and seeking some assistance with this PS Query Tool (v 9.1) issue.
I am attempting to create a outer join between a table with user names and security roles (UM_IDM_HCMROLES) and a JOB table (UM_JOB_FERPA_VW).
Issue: there are several users in the HCMROLES table that do not have job records (therefore, do not exist in the JOB_FERPA table). I need all records from the HCMROLES table and any additional fields that exist for users that do have JOB_FERPA data available. Sounds easy enough, right?
What I have so far: I created a left outer join, and also added criteria to handle the null effdate from the JOB_FERPA table. But to date I've been unsuccessful in pulling system users that do not have job records. It seems the PS tool is creating some sort of subquery to deal with the effDate, but if I remove the effdate criteria, I receive an error.
Following is the SQL statement for review. Note: I do not have access to manually update the SQL statement, I can only manipulate it through the tool. =S
Any thoughts/suggestions are very much appreciated.
Cheers,
Nancy
-----------
SELECT A.EMPLID, A.FIRST_NAME, A.LAST_NAME, A.MIDDLE_NAME, A.GROUP_NBR, B.BUSINESS_TITLE, B.EMPL_STATUS, TO_CHAR(B.EFFDT,'YYYY-MM-DD'), B.DEPTID, B.BUSINESS_UNIT
FROM PS_UM_IDM_HCMROLES A, PS_UM_JOB_FERPA_VW B
WHERE B.EMPLID = A.EMPLID(+)
AND ( B.EFFDT =
(SELECT MAX(B_ED.EFFDT) FROM PS_UM_JOB_FERPA_VW B_ED
WHERE B.EMPLID = B_ED.EMPLID
AND B.EMPL_RCD = B_ED.EMPL_RCD
AND B_ED.EFFDT <= SYSDATE)
OR B.EFFDT IS NULL)
AND A.EMPLID LIKE :1
I am attempting to create a outer join between a table with user names and security roles (UM_IDM_HCMROLES) and a JOB table (UM_JOB_FERPA_VW).
Issue: there are several users in the HCMROLES table that do not have job records (therefore, do not exist in the JOB_FERPA table). I need all records from the HCMROLES table and any additional fields that exist for users that do have JOB_FERPA data available. Sounds easy enough, right?
What I have so far: I created a left outer join, and also added criteria to handle the null effdate from the JOB_FERPA table. But to date I've been unsuccessful in pulling system users that do not have job records. It seems the PS tool is creating some sort of subquery to deal with the effDate, but if I remove the effdate criteria, I receive an error.
Following is the SQL statement for review. Note: I do not have access to manually update the SQL statement, I can only manipulate it through the tool. =S
Any thoughts/suggestions are very much appreciated.
Cheers,
Nancy
-----------
SELECT A.EMPLID, A.FIRST_NAME, A.LAST_NAME, A.MIDDLE_NAME, A.GROUP_NBR, B.BUSINESS_TITLE, B.EMPL_STATUS, TO_CHAR(B.EFFDT,'YYYY-MM-DD'), B.DEPTID, B.BUSINESS_UNIT
FROM PS_UM_IDM_HCMROLES A, PS_UM_JOB_FERPA_VW B
WHERE B.EMPLID = A.EMPLID(+)
AND ( B.EFFDT =
(SELECT MAX(B_ED.EFFDT) FROM PS_UM_JOB_FERPA_VW B_ED
WHERE B.EMPLID = B_ED.EMPLID
AND B.EMPL_RCD = B_ED.EMPL_RCD
AND B_ED.EFFDT <= SYSDATE)
OR B.EFFDT IS NULL)
AND A.EMPLID LIKE :1