The following lines contain the word 'select', 'insert', 'update' or 'delete':
select person_id
from per_all_assignments_f
where assignment_id = c_assignment_id
and sysdate between
effective_start_date and effective_end_date;
delete from pay_assignment_latest_balances
where assignment_id = p_assignment_id;
delete from pay_person_latest_balances
where person_id = l_person_id;
PROCEDURE delete_per_latest_balances
(p_person_id number,
p_assignment_id number,
p_effective_date date) is
--
-- There are 2 events, a termination of multi assignment or a creation of
-- a new multi assignment that will trigger the person level latest balances
-- to be trashed. These only need to be trashed where there are multiple
-- assignments and the people have Aggregated PAYE (DDF set on person).
-- Note this is called at assignment level hence must check for multis.
--
cursor csr_person_details (c_person_id in number,
c_effective_date in date) is
select per_information10
from per_all_people_f
where person_id = c_person_id
and c_effective_date between
effective_start_date and effective_end_date;
select count(paf.assignment_id)
from per_all_assignments_f paf
where person_id = c_person_id
and c_effective_date between
paf.effective_start_date and paf.effective_end_date;
l_function_name varchar2(25) := 'delete_per_latest_bal';
DELETE from pay_person_latest_balances
WHERE person_id = p_person_id;
end delete_per_latest_balances;