The following lines contain the word 'select', 'insert', 'update' or 'delete':
select gra.business_group_id
from per_grades gra
where gra.grade_id = p_grade_id;
procedure update_valid_grades_for_job
(p_business_group_id number,
p_job_id number,
p_date_to date)
is
--
begin
--
-- Update valid grade end dates to match the end date of the
-- job where the end date of the job is earlier than the end
-- date of the valid grade.or the previous end dates matched.
--
--
update per_valid_grades vg
set vg.date_to =
(select least(nvl(p_date_to, to_date('12/31/4712','mm/dd/yyyy')),
nvl(g.date_to, to_date('12/31/4712','mm/dd/yyyy')))
from per_grades g
where g.grade_id = vg.grade_id
and g.business_group_id + 0 = p_business_group_id)
where vg.business_group_id + 0 = p_business_group_id
and vg.job_id = p_job_id
and nvl(vg.date_to, to_date('12/31/4712','mm/dd/yyyy')) > p_date_to;
hr_utility.set_message_token('PROCEDURE','update_valid_grades');
end update_valid_grades_for_job;
procedure delete_valid_grades_for_job
(p_business_group_id number,
p_job_id number,
p_date_to date) is
--
begin
--
-- Valid grades are deleted if the end date of the job
-- has been made earlier than the start date of the
-- valid grade.
--
--
delete from per_valid_grades vg
where vg.business_group_id + 0 = p_business_group_id
and vg.job_id = p_job_id
and vg.date_from > p_date_to;
hr_utility.set_message_token('PROCEDURE','delete_valid_grades');
end delete_valid_grades_for_job;