The following lines contain the word 'select', 'insert', 'update' or 'delete':
select null
from per_all_people_f per,
per_business_groups bg
where per.person_id = p_person_id
and per.national_identifier = p_national_identifier
and per.business_group_id = bg.business_group_id
and bg.name = p_name;
select distinct
per1.person_id,
per1.national_identifier ssn,
-1
from per_all_people_f per1,
per_contact_relationships pcr
where pcr.person_id = p_person_id
and per1.person_id = pcr.contact_person_id
and per1.effective_start_date =
(select min(per2.effective_start_date)
from per_all_people_f per2
where per2.person_id = per1.person_id);
l_contact_rec.delete;
select ben_dm_group_order_s.nextval
into l_group_order
from dual;
delete from ben_dm_input_file;
hr_utility.set_location('bulk inserting new records',10);
insert into ben_dm_input_file
(input_file_id,
status,
source_business_group_name,
source_national_identifier,
source_person_id,
target_business_group_name,
target_national_identifier,
group_order,
person_type,
data_source)
values
(ben_dm_input_file_s.nextval,
'NS',
l_inp_rec(i).source_bg,
l_inp_rec(i).source_ssn,
l_inp_rec(i).source_person_id,
l_inp_rec(i).target_bg,
l_inp_rec(i).target_ssn,
l_inp_rec(i).group_order,
nvl(l_inp_rec(i).person_type,'P'),
l_inp_rec(i).data_source);
DELETE FROM ben_dm_input_file mas
WHERE ROWID > ( SELECT min(rowid)
FROM ben_dm_input_file chi
WHERE mas.source_business_group_name = chi.source_business_group_name
and mas.source_national_identifier = chi.source_national_identifier
and mas.source_person_id = chi.source_person_id
and mas.group_order = chi.group_order
and mas.target_business_group_name = chi.target_business_group_name
AND nvl(mas.target_national_identifier,mas.source_national_identifier) =
nvl(chi.target_national_identifier,chi.source_national_identifier)
) ;