The following lines contain the word 'select', 'insert', 'update' or 'delete':
p_sqlstr := 'select distinct paaf.person_id
from per_all_assignments_f paaf,
pay_payroll_actions ppa,
pay_payroll_actions ppa1,
pay_assignment_actions paa
where ppa.payroll_action_id = paa.payroll_action_id
and paa.assignment_id = paaf.assignment_id
and ppa1.payroll_action_id = :payroll_action_id
and ppa.payroll_action_id =
to_number(pay_ca_t4a_cancel_mag.get_parameter(''PAY_ACT'', ppa1.legislative_parameters))
and paaf.person_id =
nvl(pay_ca_t4a_cancel_mag.get_parameter(''PER_ID'',ppa1.legislative_parameters),paaf.person_id)
order by paaf.person_id';
select paaf.person_id,
paaf.assignment_id,
paa1.tax_unit_id,
paaf.effective_end_date,
paa.assignment_action_id,
ppa2.payroll_action_id
from
per_all_assignments_f paaf,
pay_payroll_actions ppa,
pay_payroll_actions ppa1,
pay_payroll_actions ppa2,
pay_assignment_actions paa,
pay_assignment_actions paa1,
pay_action_interlocks int
where
ppa.payroll_action_id = paa.payroll_action_id
and paa.assignment_id = paaf.assignment_id
and ppa1.payroll_action_id = p_pactid
and paaf.person_id between p_stperson and p_endperson
and ppa.payroll_action_id =
to_number(pay_ca_t4a_cancel_mag.get_parameter('PAY_ACT', ppa1.legislative_parameters))
and ppa2.report_type in ('T4A','CAEOY_T4A_AMEND_PP')
and int.locking_action_id = paa.assignment_action_id
and paa1.assignment_action_id = int.locked_action_id
and ppa2.payroll_action_id = paa1.payroll_action_id
and ppa2.action_status = 'C'
and paa.action_status = 'C'
and paa1.action_status = 'C'
and paa.assignment_action_id
not in (select paa2.assignment_action_id
from pay_action_interlocks pai, pay_assignment_actions paa2
where paa2.assignment_action_id = pai.locked_action_id
and paa2.payroll_action_id =
to_number(pay_ca_t4a_cancel_mag.get_parameter('PAY_ACT', ppa1.legislative_parameters))
)
and paaf.effective_start_date = (select max(paaf2.effective_start_date)
from per_all_assignments_f paaf2
where paaf2.assignment_id = paa.assignment_id
and paaf2.effective_start_date <= ppa.effective_date)
order by paaf.person_id;
select paaf.person_id,
paaf.assignment_id,
paa1.tax_unit_id,
paaf.effective_end_date,
paa.assignment_action_id,
ppa2.payroll_action_id
from
per_all_assignments_f paaf,
pay_payroll_actions ppa,
pay_payroll_actions ppa1,
pay_payroll_actions ppa2,
pay_assignment_actions paa,
pay_assignment_actions paa1,
pay_action_interlocks int
where
ppa.payroll_action_id = paa.payroll_action_id
and paa.assignment_id = paaf.assignment_id
and ppa1.payroll_action_id = p_pactid
and paaf.person_id between p_stperson and p_endperson
and ppa.payroll_action_id =
to_number(pay_ca_t4a_cancel_mag.get_parameter('PAY_ACT', ppa1.legislative_parameters))
and ppa2.report_type in ('T4A','CAEOY_T4A_AMEND_PP')
and int.locking_action_id = paa.assignment_action_id
and paa1.assignment_action_id = int.locked_action_id
and ppa2.payroll_action_id = paa1.payroll_action_id
and ppa2.action_status = 'C'
and paa.action_status = 'C'
and paa1.action_status = 'C'
and exists (select 1
from hr_assignment_set_amendments hasa,
per_assignments_f paf
where hasa.assignment_set_id = l_asg_set_id
and upper(hasa.include_or_exclude) = 'I'
and hasa.assignment_id = paf.assignment_id
and paf.person_id = paaf.person_id)
and paa.assignment_action_id
not in (select paa2.assignment_action_id
from pay_action_interlocks pai,
pay_assignment_actions paa2
where paa2.assignment_action_id = pai.locked_action_id
and paa2.payroll_action_id =
to_number(pay_ca_t4a_cancel_mag.get_parameter('PAY_ACT', ppa1.legislative_parameters))
)
and paaf.effective_start_date = (select max(paaf2.effective_start_date)
from per_all_assignments_f paaf2
where paaf2.assignment_id = paa.assignment_id
and paaf2.effective_start_date <= ppa.effective_date)
order by paaf.person_id;
SELECT pay_assignment_actions_s.nextval
INTO lockingactid
FROM dual;
UPDATE pay_assignment_actions aa
SET aa.serial_number = to_char(l_person_id)
WHERE aa.assignment_action_id = lockingactid;
SELECT ppa.payroll_action_id,ppa.business_group_id
FROM hr_organization_information hoi,
pay_payroll_actions ppa
WHERE hoi.organization_id = to_number(c_trans_id)
AND hoi.org_information_context='Fed Magnetic Reporting'
AND ppa.report_type in ('T4A','CAEOY_T4A_AMEND_PP') -- T4A Archiver Report Type
AND hoi.organization_id = pay_ca_t4a_cancel_mag.get_parameter('TRANSFER_GRE',
ppa.legislative_parameters)
AND ppa.effective_date = to_date('31-12-'||c_year,'DD-MM-YYYY');
SELECT DISTINCT ppa.payroll_action_id, hoi.organization_id, hou.name
FROM pay_payroll_actions ppa,
hr_organization_information hoi,
hr_all_organization_units hou
WHERE hoi.org_information_context = 'Canada Employer Identification'
AND hoi.org_information11 = p_trans
AND hou.business_group_id = p_bg_id
AND hou.organization_id = hoi.organization_id
AND ppa.report_type in ('T4A','CAEOY_T4A_AMEND_PP')
AND ppa.effective_date = to_date('31-12-'||p_year,'DD-MM-YYYY')
AND ppa.business_group_id = p_bg_id
AND hoi.organization_id = pay_ca_t4a_cancel_mag.get_parameter('TRANSFER_GRE',
ppa.legislative_parameters);
SELECT hou.name
FROM hr_all_organization_units hou
WHERE hou.organization_id = to_number(b_org_id);
SELECT fai.value
FROM ff_archive_items fai,
ff_database_items fdi
WHERE fai.user_entity_id = fdi.user_entity_id
AND fai.context1 = b_context_id
AND fdi.user_name = b_user_name;
SELECT ppa.legislative_parameters,
ppa.effective_date,
ppa.business_group_id,
ppa.report_type
INTO p_legislative_parameters,
p_year_end,
p_business_group_id,
p_report_type
FROM pay_payroll_actions ppa
WHERE payroll_action_id = p_pactid;
SELECT
fnd_global.local_chr(13) || fnd_global.local_chr(10)
INTO EOL
FROM dual;
SELECT to_char(to_number(p_data), p_format)
INTO l_data FROM dual;
SELECT to_char(to_number(p_data), '99999999999999999999999999999999999990.99')
INTO l_data FROM dual;
SELECT to_number(pai.action_information5) ppreg_amt,
pai.action_information4 ppreg_no
FROM pay_action_information pai,pay_payroll_actions ppa
WHERE pai.action_context_id = cp_pact_id
AND pai.tax_unit_id = cp_tax_unit_id
AND ppa.payroll_action_id = pai.action_context_id
AND pai.effective_date = ppa.effective_date
AND pai.action_information_category = 'CAEOY PENSION PLAN INFO'
ORDER BY 1 DESC;
select max(paa1.payroll_action_id)
into l_context1
from pay_assignment_actions paa,
pay_assignment_actions paa1,
pay_action_interlocks int
where int.locking_action_id = paa.assignment_action_id
and paa1.assignment_action_id = int.locked_action_id
and paa.payroll_action_id = pay_magtape_generic.get_parameter_value('PAYROLL_ACTION_ID');
SELECT
paa.assignment_action_id,
paa.payroll_action_id
FROM pay_assignment_actions paa,
pay_payroll_actions ppa,
pay_action_interlocks pai,
pay_action_interlocks pai2
WHERE pai.locking_action_id = p_assg_actid
AND pai.locked_action_id = pai2.locking_action_id
AND pai2.locked_action_id = paa.assignment_action_id
AND ppa.payroll_action_id = paa.payroll_action_id
AND ppa.report_type in ('CAEOY_T4A_AMEND_PP','T4A')
ORDER BY
paa.assignment_action_id DESC;
SELECT
serial_number
FROM
pay_assignment_actions
WHERE assignment_action_id = p_mag_asg_action_id;