The following lines contain the word 'select', 'insert', 'update' or 'delete':
select pet.element_name
,pet.business_group_id
,ppa.payroll_action_id
,prr.source_type
,prr.run_result_id
FROM pay_element_types_f pet
,pay_element_type_extra_info pete
,pay_run_results prr
,pay_assignment_actions paas
,pay_payroll_actions ppa
where
pete.EEI_INFORMATION_CATEGORY='PQP_VEHICLE_MILEAGE_INFO'
AND pet.element_type_id=pete.element_type_id
AND pete.EEI_INFORMATION1 in ('C','P','CM','CP','PP','PM')
AND pet.business_group_id=p_business_group_id
AND paas.assignment_id =p_assignment_id
AND paas.assignment_action_id=prr.assignment_action_id
AND pete.element_type_id=prr.element_type_id
AND paas.payroll_action_id=ppa.payroll_action_id
AND ppa.action_type in ('Q','R','V')
AND paas.action_status='C'
AND prr.source_id = p_element_entry_id
AND paas.assignment_action_id = p_assignment_action_id
AND pete.EEI_INFORMATION1 = nvl(p_vehicle_type,pete.EEI_INFORMATION1)
AND substr(pete.EEI_INFORMATION1,0,1) = nvl(p_ownership,substr(pete.EEI_INFORMATION1,0,1));
Select rr2.source_id
FROM pay_run_results rr1,
pay_run_results rr2
WHERE
rr1.run_result_id = cp_run_result_id
AND rr1.source_id = rr2.run_result_id;
SELECT pbt.balance_name,pbt.balance_type_id ,pbd.balance_dimension_id
FROM pay_balance_types pbt
,pay_defined_balances pdb
,pay_balance_dimensions pbd
WHERE balance_name like p_element_name||' '||p_balance_name
AND pbd.legislation_code='GB'
AND pbd.dimension_name='_ELEMENT_ITD'
AND pdb.balance_type_id=pbt.balance_type_id
AND pdb.balance_dimension_id=pbd.balance_dimension_id
AND pbt.balance_type_id=pdb.balance_type_id;
SELECT nvl((fnd_number.canonical_to_number(TARGET.result_value)
* FEED.scale),0) tot
FROM pay_run_result_values TARGET
, pay_balance_feeds_f FEED
, pay_run_results RR
, pay_assignment_actions ASSACT
, pay_assignment_actions BAL_ASSACT
, pay_payroll_actions PACT
WHERE BAL_ASSACT.assignment_action_id = cp_assignment_action_id
AND FEED.balance_type_id = cp_balance_type_id
AND FEED.input_value_id = TARGET.input_value_id
AND TARGET.run_result_id = RR.run_result_id
AND RR.assignment_action_id = ASSACT.assignment_action_id
AND ASSACT.payroll_action_id = PACT.payroll_action_id
AND assact.payroll_action_id = cp_payroll_action_id
AND PACT.effective_date between FEED.effective_start_date
AND FEED.effective_end_date
AND RR.status in ('P','PA')
AND ASSACT.action_sequence <= BAL_ASSACT.action_sequence
AND ASSACT.assignment_id = BAL_ASSACT.assignment_id
AND (( RR.source_id = cp_element_entry_id and source_type in ( 'E','I'))
OR ( rr.source_type in ('R','V') /* reversal */
AND exists
( SELECT null from pay_run_results rr1
WHERE rr1.source_id = cp_element_entry_id
AND rr1.run_result_id = rr.source_id
AND rr1.source_type in ( 'E','I'))));