The following lines contain the word 'select', 'insert', 'update' or 'delete':
p_sql := 'select distinct person_id ' ||
'from per_people_f ppf, ' ||
'pay_payroll_actions ppa ' ||
'where ppa.payroll_action_id = :payroll_action_id ' ||
'and ppa.business_group_id = ppf.business_group_id ' ||
'order by ppf.person_id';
select pay_assignment_actions_s.nextval
from dual;
select distinct a.assignment_id,
pay_core_utils.get_parameter('ARCHIVE_RUN_ID', pa.legislative_parameters) archive_run_id,
pay_core_utils.get_parameter('LEGAL_ENTITY_ID', pa.legislative_parameters) legal_entity_id
from per_assignments_f a, /* Bug# 2920732 */
per_people_f p,
pay_payroll_actions pa
where pa.payroll_action_id = c_payroll_action_id
and p.person_id between c_start_person_id and c_end_person_id
and p.person_id = a.person_id
and p.business_group_id = pa.business_group_id
and exists /* Bug No : 2242653 */
(select null
from
pay_payroll_actions ppa,
pay_assignment_actions pac
where ppa.payroll_action_id = pay_core_utils.get_parameter('ARCHIVE_RUN_ID', pa.legislative_parameters)
and ppa.action_type = 'X'
and ppa.action_status = 'C'
and ppa.payroll_action_id = pac.payroll_action_id
and pac.assignment_id = a.assignment_id
)
and not exists/*Bug:2858063*/
(
select pai.locking_action_id
from
pay_action_interlocks pai,
pay_assignment_actions paa1,--assignment action id of the action that locks archive
pay_assignment_actions paa2, -- assignment action id of the magtape
pay_payroll_actions ppa1, -- payroll action id of the process that locks archive
pay_payroll_actions ppa2 -- payroll action id of the magtape process
where pai.locked_action_id = paa1.assignment_action_id -- archive is locked
and pai.locking_action_id = paa2.assignment_action_id -- mgtape is looking the archive
and paa1.assignment_id = paa2.assignment_id
and paa1.assignment_id = a.assignment_id
and ppa1.action_type = 'X'
and ppa1.action_status = 'C'
and ppa1.report_type = 'SG_IRAS_ARCHIVE'
and ppa2.action_type = 'X'
and ppa2.action_status = 'C'
and ppa2.report_type = pa.report_type /* Bug#2833530 */
and ppa1.payroll_action_id = paa1.payroll_action_id
and ppa2.payroll_action_id = paa2.payroll_action_id
and ppa2.report_qualifier='SG'
and to_char(ppa2.effective_date, 'YYYY') =
(
select
pay_core_utils.get_parameter('BASIS_YEAR', ppa_arch.legislative_parameters)
from
pay_payroll_actions ppa_arch
where
ppa_arch.payroll_action_id =
pay_core_utils.get_parameter('ARCHIVE_RUN_ID', pa.legislative_parameters)
) /* Bug#4888368 */
)
and not exists
(select null
from per_people_extra_info pei
where pei.person_id = p.person_id
and pei.pei_information1 is not null
and pei.information_type = 'HR_IR21_PROCESSING_DATES_SG');
select pac.assignment_action_id
from pay_assignment_actions pac
where pac.assignment_id = c_assignment_id
and pac.payroll_action_id = c_payroll_action_id;