The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT distinct(det.retro_batch_id) batch_id,
tim.id tim_id,
tbs.status batch_status,
pbh.object_version_number
FROM pay_batch_headers pbh,
hxt_batch_states tbs,
hxt_timecards_x tim,
hxt_det_hours_worked_x det
WHERE det.pay_status = 'R'
AND tbs.batch_id = det.retro_batch_id
AND det.retro_batch_id BETWEEN nvl(c_retro_batch_id,0)
AND nvl(c_retro_batch_id,999999999999)
AND (pbh.batch_reference LIKE nvl(c_reference_num , '%')
OR (pbh.batch_reference IS NULL AND c_reference_num IS NULL))
AND tbs.status in ('VE','H','VT','VV','VW') -- RETROPAY
AND tim.id = det.tim_id
AND pbh.batch_id = tbs.batch_id
AND NOT EXISTS( SELECT 1
FROM hxt_det_hours_worked_f_ar ar
WHERE ar.retro_batch_id = pbh.batch_id)
AND pbh.business_group_id = p_bus_group_id;
SELECT pbh.batch_name, pbh.batch_id
FROM pay_batch_headers pbh
WHERE pbh.business_group_id = p_bus_group_id
AND EXISTS (SELECT 'x'
FROM hxt_det_hours_worked_x det, hxt_batch_states hbs
WHERE hbs.batch_id = pbh.batch_id
AND det.retro_batch_id = hbs.batch_id
AND hbs.status in ('VE','H','VT','VV','VW'))
ORDER BY pbh.batch_id;
SELECT pbh.batch_id
FROM pay_batch_headers pbh
WHERE pbh.business_group_id = p_bus_group_id
AND pbh.batch_id BETWEEN p_start
AND p_end
AND EXISTS (SELECT 'x'
FROM hxt_det_hours_worked_x det, hxt_batch_states hbs
WHERE hbs.batch_id = pbh.batch_id
AND det.retro_batch_id = hbs.batch_id
AND hbs.status in ('VE','H','VT','VV','VW'))
ORDER BY pbh.batch_id;
HXT_BATCH_PROCESS.Insert_Pay_Batch_Errors( batch_rec.batch_id,
'VE',
'',
l_return);
HXT_BATCH_PROCESS.Insert_Pay_Batch_Errors( batch_rec.batch_id,
'W',
'',
l_return);
HXT_BATCH_PROCESS.Insert_Pay_Batch_Errors( batch_rec.batch_id,
'VE',
'',
l_return);
HXT_BATCH_PROCESS.Insert_Pay_Batch_Errors( batch_rec.batch_id,
'VE',
'',
l_return);
HXT_BATCH_PROCESS.Insert_Pay_Batch_Errors( batch_rec.batch_id,
'VE',
'',
l_return);
HXT_BATCH_PROCESS.Insert_Pay_Batch_Errors( batch_rec.batch_id,
'VE',
'',
l_return);
HXT_BATCH_PROCESS.Insert_Pay_Batch_Errors( l_batch_id,
'VE',
sqlerrm,
l_return);
HXT_BATCH_PROCESS.Insert_Pay_Batch_Errors( batch_rec.batch_id,
'VE', -- RETROPAY
'',
l_return);
END IF; -- end process selections
HXT_BATCH_PROCESS.Insert_Pay_Batch_Errors( l_batch_id,
'VE', -- RETROPAY
sqlerrm,
l_return);