563: p_error_stack IN OUT NOCOPY ErrorStackType,
564: p_supervisor_list OUT NOCOPY SupervisorListType) IS
565: CURSOR c_hr_hier(p_employee_id NUMBER, p_business_group_id NUMBER) IS
566: SELECT pera.supervisor_id
567: FROM per_assignments_f pera
568: WHERE trunc(SYSDATE) BETWEEN pera.effective_start_date AND pera.effective_end_date
569: AND pera.person_id = p_employee_id
570: AND pera.primary_flag = 'Y'
571: AND EXISTS
569: AND pera.person_id = p_employee_id
570: AND pera.primary_flag = 'Y'
571: AND EXISTS
572: (SELECT '1'
573: FROM per_people_f PERF, per_assignments_f PERA1
574: WHERE trunc(sysdate) BETWEEN PERF.effective_start_date
575: AND PERF.effective_end_date
576: AND PERF.person_id = PERA.supervisor_id
577: AND PERA1.person_id = PERF.person_id
668: ** Added condition pera.person_id = p_employee_id to SQL
669: */
670: /* Bug 2605927. Changed the SQL and to construct the list */
671:
672: /* Bug 2794501. When selecting the records from per_assignments_f only the
673: records corresponding to assignment_type 'E' should be selected */
674:
675: CURSOR c_hr_hier(p_employee_id NUMBER, p_business_group_id NUMBER) IS
676: SELECT pera.supervisor_id
673: records corresponding to assignment_type 'E' should be selected */
674:
675: CURSOR c_hr_hier(p_employee_id NUMBER, p_business_group_id NUMBER) IS
676: SELECT pera.supervisor_id
677: FROM per_assignments_f pera
678: WHERE
679: EXISTS
680: (SELECT '1'
681: FROM per_people_f PERF, per_assignments_f PERA1
677: FROM per_assignments_f pera
678: WHERE
679: EXISTS
680: (SELECT '1'
681: FROM per_people_f PERF, per_assignments_f PERA1
682: WHERE trunc(sysdate) BETWEEN PERF.effective_start_date
683: AND PERF.effective_end_date
684: AND PERF.person_id = PERA.supervisor_id
685: AND PERA1.person_id = PERF.person_id