The following lines contain the word 'select', 'insert', 'update' or 'delete':
select
paf.payroll_id,
ppa.effective_date,
cdv.branch_code
from
pay_payroll_actions ppa,
pay_assignment_actions paa,
pay_za_branch_cdv_details cdv,
pay_pre_payments ppp,
pay_personal_payment_methods_f ppm,
pay_external_accounts pea,
per_assignments_f paf,
pay_payrolls_f ppf
where ppa.payroll_action_id = p_payroll_action_id
and ppf.payroll_name = p_payroll_name
and cdv.branch_code = p_branch_code
and paa.serial_number is null
and ppa.payroll_action_id = paa.payroll_action_id
and paa.action_status not in ('V', 'E')
and paa.pre_payment_id = ppp.pre_payment_id
and paa.assignment_id = paf.assignment_id
and ppa.effective_date between paf.effective_start_date and paf.effective_end_date
and ppa.effective_date between ppm.effective_start_date and ppm.effective_end_date
and ppa.effective_date between ppf.effective_start_date and ppf.effective_end_date
and ppm.personal_payment_method_id = ppp.personal_payment_method_id
and ppm.external_account_id = pea.external_account_id
and cdv.branch_code = pea.segment1
and paf.payroll_id = ppf.payroll_id
order by ppf.payroll_name, ppa.effective_date, cdv.bank_name, cdv.branch_name,
cdv.branch_code
for update of paa.serial_number;
update pay_assignment_actions
set serial_number = to_char(p_start_cheque)
where current of cheque_csr;