The following lines contain the word 'select', 'insert', 'update' or 'delete':
select payroll_action_id
from pay_payroll_actions
where request_id = p_prepayments_req_id
and business_group_id = p_business_group_id
and payroll_id = p_payroll_id
and action_type = 'P' ;
select run_type_name||'-'||ptp.period_name||'-'||ppa.payroll_action_id run_type_period_name
from pay_payroll_actions ppa,
pay_payroll_actions rppa,
pay_assignment_actions paa,
pay_assignment_actions rpaa,
pay_action_interlocks pai,
pay_run_types_f prt,
per_time_periods ptp
where ppa.payroll_action_id = p_run_type_period
and paa.payroll_action_id = ppa.payroll_action_id
and ppa.action_type in ('P','U')
and ppa.action_status = 'C'
and rppa.action_type in ('Q','R')
and rppa.action_status = 'C'
and rpaa.payroll_action_id = rppa.payroll_action_id
and rpaa.assignment_id = paa.assignment_id
and pai.locking_action_id = paa.assignment_action_id
and pai.locked_action_id = rpaa.assignment_action_id
and ppa.effective_date >= rppa.effective_date
and rpaa.run_type_id = prt.run_type_id
and rppa.time_period_id = ptp.time_period_id
and ppa.payroll_action_id = paa.payroll_action_id
and rpaa.assignment_action_id = (select max(paa_locked.assignment_action_id)
from pay_assignment_actions paa_locked,
pay_action_interlocks pai_locking
where pai_locking.locking_action_id =
(select max(paa1.assignment_action_id)
from pay_assignment_actions paa1
where paa1.payroll_action_id = ppa.payroll_action_Id)
and paa_locked.assignment_action_id = pai_locking.locked_action_id)
and ppa.effective_date between prt.effective_start_date and prt.effective_end_date
and rppa.effective_date between ptp.start_date and ptp.end_date;
select count(paa.assignment_action_id) ASG_COUNT,
paa.action_status ASG_STATUS
from pay_assignment_actions paa,
pay_payroll_actions ppa,
per_business_groups pbg
where paa.payroll_action_id = ppa.payroll_action_id
and ppa.request_id = ln_req_id
and ppa.business_group_id = pbg.business_group_id
and ppa.payroll_id = l_payroll_id -- Bug 5042942
and ppa.effective_date between pbg.date_from and nvl(pbg.date_to, ppa.effective_date) -- Bug 5042942
and ppa.action_type = 'R' -- Bug 5042942
and paa.source_action_id is null
and paa.run_type_id is null
group by pbg.name, paa.action_status;