185: end if;
186: begin
187: select pps.period_of_service_id
188: into l_period_of_service_id
189: from per_periods_of_service pps
190: where pps.person_id = p_person_id
191: and pps.date_start = p_s_hire_date;
192: --
193: exception
822: IS
823: cursor old_pps_exists
824: is
825: select 1
826: from per_periods_of_service pps
827: where pps.person_id = p_person_id
828: and pps.actual_termination_date is not null;
829: --
830: -- 70.11 nvl(pps.final_process_date,p_start_date)+1 < p_start_date;
831: --
832: cursor pps_not_ended
833: is
834: select pps.final_process_date
835: from per_periods_of_service pps
836: where pps.person_id = p_person_id
837: and pps.date_start = (select max(date_start)
838: from per_periods_of_service pps1
839: where pps1.person_id = pps.person_id
834: select pps.final_process_date
835: from per_periods_of_service pps
836: where pps.person_id = p_person_id
837: and pps.date_start = (select max(date_start)
838: from per_periods_of_service pps1
839: where pps1.person_id = pps.person_id
840: and pps1.date_start
842: and nvl(pps.final_process_date,p_start_date) >= p_start_date;
925: l_period_of_service_id number;
926: --
927: cursor csr_earliest_date is
928: select date_start, period_of_service_id,actual_termination_date
929: from per_periods_of_service
930: where p_person_id = person_id
931: order by date_start desc ;-- fix for bug 4672540.
932: --
933: begin