The following lines contain the word 'select', 'insert', 'update' or 'delete':
J.N. Louw 07-09-2001 115.2 Updated pro_rate_days
A.Stander 19-11-1998 110.0 Initial version
*/
-------------------------------------------------------------------
function get_workdays(period_1 IN date,
period_2 IN date)
return number is
working_days number;
select to_char(next_date, 'DAY') into days from dual;
CURSOR c2 (x_payroll_action_id number) is select effective_start_date,effective_end_date
from per_assignments_f
where payroll_id = (select payroll_id
from pay_payroll_actions
where payroll_action_id = x_payroll_action_id)
and assignment_id = (select assignment_id
from pay_assignment_actions
where payroll_action_id = x_payroll_action_id)
order by effective_start_date;
select time_period_id
into x_time_period_id
from pay_payroll_actions
where payroll_action_id = x_payroll_action_id;
SELECT start_date,end_date
into start_date,end_date
from per_time_periods
where payroll_id = (select payroll_id
from pay_payroll_actions
where payroll_action_id = x_payroll_action_id)
and time_period_id = x_time_period_id;
select get_workdays(start_date,end_date) into
total_days from dual;
select get_workdays(start_date,eff_end_date) into
days_worked from dual;
select get_workdays(eff_start_date,eff_end_date) into
days_worked from dual;
select get_workdays(eff_start_date,end_date) into
days_worked from dual;
SELECT ptp.start_date
, ptp.end_date
FROM per_time_periods ptp
, pay_payroll_actions ppa
WHERE ppa.payroll_action_id = p_ppa_id
AND ptp.time_period_id = ppa.time_period_id;
SELECT min(asg.effective_start_date) start_date
, max(asg.effective_end_date) end_date
FROM per_assignment_status_types past
, per_all_assignments_f asg
WHERE asg.assignment_id = p_asg_id
AND asg.assignment_status_type_id = past.assignment_status_type_id
AND past.per_system_status in ('ACTIVE_ASSIGN', 'SUSP_ASSIGN');