The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT pei.PERSON_ID,
per1.full_name,
per1.employee_number,
per1.effective_start_date,
pei.PEI_INFORMATION1,
pei.PEI_INFORMATION2,
pei.PEI_INFORMATION3,
pei.PEI_INFORMATION4,
pei.PEI_INFORMATION5,
pei.PEI_INFORMATION6,
pei.PEI_INFORMATION7,
pei.PEI_INFORMATION8,
pei.PERSON_EXTRA_INFO_ID
FROM per_people_extra_info pei
, per_all_people_f per1
WHERE pei.PEI_INFORMATION_CATEGORY = 'FR_MEDIC_EXAM'
AND pei.person_id = per1.person_id
AND per1.business_group_id = p_business_group_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
and per2.business_group_id = p_business_group_id)
AND pei.PEI_INFORMATION30 IS NULL
order by per1.full_name;
BEGIN -- Insert new medical examinations section
SAVEPOINT start_insert;
update per_people_extra_info
set PEI_INFORMATION30 = to_char(l_medical_assessment_id)
where person_id = l_medical_exam.person_id
and PEI_INFORMATION_CATEGORY = 'FR_MEDIC_EXAM'
and PERSON_EXTRA_INFO_ID = l_medical_exam.PERSON_EXTRA_INFO_ID;
rollback to start_insert;
END; -- end of section inserting new medical exam