The following lines contain the word 'select', 'insert', 'update' or 'delete':
procedure update_it_tax_data
(p_rec in out nocopy per_qh_tax_query.taxrec
,p_person_id in per_all_people_f.person_id%type
,p_assignment_id in per_all_assignments_f.assignment_id%type
,p_legislation_code in varchar2
,p_effective_date in date
) is
l_proc varchar2(72) := g_package||'update_it_tax_data';
l_dynamic_insert_allowed per_coll_agree_grades_v.dynamic_insert_allowed%type;
update per_all_people_f
set per_information2 = p_rec.tax_field1
where person_id = p_person_id
and p_effective_date between effective_start_date and effective_end_date;
select id_flex_num into l_id_flex_num
from fnd_id_flex_structures_vl
where id_flex_structure_name = 'IT_CAGR'
and id_flex_code = 'CAGR';
select cagr_grade_def_id into l_old_cagr_grade_def_id
from per_all_assignments_f
where person_id = p_person_id
and assignment_id = p_assignment_id
and cagr_id_flex_num = l_id_flex_num
and p_effective_date between effective_start_date and effective_end_date
and rownum = 1;
update per_all_assignments_f
set cagr_grade_def_id = l_new_cagr_grade_def_id,
collective_agreement_id = p_rec.tax_field6,
cagr_id_flex_num = l_id_flex_num
where person_id = p_person_id
and assignment_id = p_assignment_id
and cagr_id_flex_num = l_id_flex_num
and p_effective_date between effective_start_date and effective_end_date;
update per_all_assignments_f
set cagr_grade_def_id = null, -- added to not populate id_flex_num if no collective agreement id is found
collective_agreement_id = p_rec.tax_field6,
cagr_id_flex_num = null
where person_id = p_person_id
and assignment_id = p_assignment_id
and cagr_id_flex_num = l_id_flex_num
and p_effective_date between effective_start_date and effective_end_date;
update per_all_assignments_f
set cagr_grade_def_id = l_new_cagr_grade_def_id,
collective_agreement_id = p_rec.tax_field6,
cagr_id_flex_num = l_id_flex_num
where person_id = p_person_id
and assignment_id = p_assignment_id
and p_effective_date between effective_start_date and effective_end_date;
update per_all_assignments_f
set cagr_grade_def_id = null,
collective_agreement_id = p_rec.tax_field6,
cagr_id_flex_num = null
where person_id = p_person_id
and assignment_id = p_assignment_id
and p_effective_date between effective_start_date and effective_end_date;
end update_it_tax_data;
select per_information2 into p_rec.tax_field1
from per_all_people_f
where person_id = p_person_id
and p_effective_date between effective_start_date and effective_end_date
and rownum = 1;
select id_flex_num into l_id_flex_num
from fnd_id_flex_structures_vl
where id_flex_structure_name = 'IT_CAGR'
and id_flex_code = 'CAGR';
select cagr_grade_def_id into l_old_cagr_grade_def_id
from per_all_assignments_f
where person_id = p_person_id
and assignment_id = p_assignment_id
and cagr_id_flex_num = l_id_flex_num
and p_effective_date between effective_start_date and effective_end_date
and rownum = 1;
select segment1, segment2, segment3 into l_cagr_segment1, l_cagr_segment2, l_cagr_segment3
from per_cagr_grades_def
where cagr_grade_def_id = l_old_cagr_grade_def_id
and id_flex_num = l_id_flex_num
and rownum = 1;