The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT pei.PERSON_ID,
per1.full_name,
per1.employee_number,
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.PEI_INFORMATION9,
pei.PERSON_EXTRA_INFO_ID
FROM per_people_extra_info pei
, per_all_people_f per1
WHERE pei.PEI_INFORMATION_CATEGORY = 'FR_DISABILITY'
AND pei.person_id = per1.person_id
AND per1.business_group_id = p_business_group_id
AND per1.effective_start_date = (select max(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;
SELECT MIN(EFFECTIVE_START_DATE), MAX(effective_end_date)
INTO l_person_start_date, l_person_end_date
FROM per_all_people_f
WHERE person_id = l_disabled.person_id;
update per_people_extra_info
set PEI_INFORMATION30 = 'INVALID_DATES'
where person_id = l_disabled.person_id
and PEI_INFORMATION_CATEGORY = 'FR_DISABILITY'
and PERSON_EXTRA_INFO_ID = l_disabled.PERSON_EXTRA_INFO_ID;
SELECT decode(l_disabled.PEI_INFORMATION9, 'Y', 'OCC_INC', NULL)
INTO l_reason
from DUAL;
BEGIN -- Insert new disability section
SAVEPOINT start_insert;
hr_utility.set_location('about to update',5);
PER_DISABILITY_API.delete_disability(p_disability_id => l_disability_id,
p_effective_date => l_disabilities_end_date,
p_datetrack_mode => 'DELETE',
p_object_version_number => l_object_version_number,
p_effective_start_date => l_effective_start_date,
p_effective_end_date => l_effective_end_date);
update per_people_extra_info
set PEI_INFORMATION30 = to_char(l_disability_id)
where person_id = l_disabled.person_id
and PEI_INFORMATION_CATEGORY = 'FR_DISABILITY'
and PERSON_EXTRA_INFO_ID = l_disabled.PERSON_EXTRA_INFO_ID;
rollback to start_insert;
END; -- end of section inserting new disability