The following lines contain the word 'select', 'insert', 'update' or 'delete':
select start_date,end_date
from per_time_periods
where time_period_id = p_time_period_id;
select max(end_date)
from per_time_periods
where payroll_id = p_payroll_id;
select time_period_id,end_date
from per_time_periods
where payroll_id = p_payroll_id
and end_date >= l_min_py_period
and end_date <= l_max_py_period
order by end_date;
select time_period_id,end_date
from per_time_periods
where payroll_id = p_overtime_payroll_id
and end_date >= l_min_ot_period
and end_date <= l_max_ot_period
order by end_date;
/* C_PAYROLL_PERIODS will select all the payroll periods in the
payroll calendar starting with the one defined by
P_START_PY_PERIOD_ID, ordered by PERIOD_START_DATE */
--
open C_PAYROLL_PERIODS;
/* C_OVERTIME_PERIODS will select all the overtime periods in the
overtime calendar starting with the one defined by
P_START_OT_PERIOD_ID, ordered by PERIOD_START_DATE */
--
For o in C_OVERTIME_PERIODS loop
--
/* Ensure that the overtime week end date is on or before the payroll period
end date */
--
IF o.end_date > l_py_period_end_date then
fnd_message.set_name('PAY','PAY_74950_OT_AFTER_PAYROLL');
/* Update the overtime period record to record the payroll period in which
it will be paid */
--
UPDATE PER_TIME_PERIODS
SET PRD_INFORMATION_CATEGORY = 'FR',
PRD_INFORMATION1 = to_char(p_payroll_id),
PRD_INFORMATION2 = to_char(l_py_period_id)
where TIME_PERIOD_ID = o.TIME_PERIOD_ID
and (P_OVERRIDE = 'Y' or
(nvl(P_OVERRIDE,'N') <> 'Y' and PRD_INFORMATION1 is null));