The following lines contain the word 'select', 'insert', 'update' or 'delete':
select p_upload_date - 28
from per_assignments_f paf
, per_time_periods ptp
where paf.assignment_id = p_assignment_id
and ptp.payroll_id = paf.payroll_id
and p_upload_date between ptp.start_date and ptp.end_date
and p_upload_date between paf.effective_start_date and paf.effective_end_date;
select hr_nz_routes.fiscal_span_start( p_upload_date, 1, paf.business_group_id )
from per_assignments_f paf
, per_time_periods ptp
where paf.assignment_id = p_assignment_id
and ptp.payroll_id = paf.payroll_id
and p_upload_date between ptp.start_date and ptp.end_date
and p_upload_date between paf.effective_start_date and paf.effective_end_date;
select hr_nz_routes.fiscal_span_start( p_upload_date, 4, paf.business_group_id )
from per_assignments_f paf
, per_time_periods ptp
where paf.assignment_id = p_assignment_id
and ptp.payroll_id = paf.payroll_id
and p_upload_date between ptp.start_date and ptp.end_date
and p_upload_date between paf.effective_start_date and paf.effective_end_date;
select nvl(ptp.start_date, end_of_time)
from per_time_periods ptp
, per_assignments_f paf
where paf.assignment_id = p_assignment_id
and p_upload_date between paf.effective_start_date and paf.effective_end_date
and ptp.payroll_id = paf.payroll_id
and p_upload_date between ptp.start_date and ptp.end_date;
select nvl(greatest(min(ptp.start_date), min(paf.effective_start_date)),end_of_time)
, paf.business_group_id
from per_assignments_f paf
, per_time_periods ptp
where paf.assignment_id = p_assignment_id
and paf.payroll_id = ptp.payroll_id
and paf.effective_start_date <= p_upload_date
and ptp.start_date <= p_upload_date
group by paf.business_group_id;
select nvl(greatest(min(paf.effective_start_date), p_expiry_date), end_of_time)
from per_assignments_f paf
, per_time_periods ptp
where paf.assignment_id = p_assignment_id
and ptp.payroll_id = paf.payroll_id
and p_upload_date between ptp.start_date and ptp.end_date
and paf.effective_start_date <= p_upload_date
and paf.effective_end_date >= p_expiry_date;