The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT DISTINCT cbtl.order_header_id
FROM csi_batch_txn_lines cbtl
WHERE batch_id = -1
AND NOT EXISTS (SELECT 'x' --do not assign a batch_id to an order that is
-- being processed
FROM csi_batch_txn_lines cbtl2
WHERE cbtl2.order_header_id = cbtl.order_header_id
AND cbtl2.processed_flag IN (1,2)
AND cbtl2.batch_id <> -1)
ORDER BY order_header_id;
SELECT csi_batch_txn_lines_s.nextval
INTO l_seq
FROM dual;
UPDATE csi_batch_txn_lines cbtl
SET batch_id = l_seq + MOD(l_header_id(i), p_num_workers)
WHERE order_header_id = l_header_id(i);
SELECT csi_batch_txn_lines_s.nextval
INTO l_seq
FROM dual;
select * from (
SELECT DISTINCT ctl.batch_id
FROM csi_batch_txn_lines CTL
WHERE ctl.processed_flag = 0
AND batch_id >= p_batch_lower_limit
)
where ROWNUM <= cp_workers_available
;
SELECT COUNT(*)
INTO l_active_num
FROM FND_CONCURRENT_REQUESTS FCR,
fnd_concurrent_programs FCP
WHERE FCR.concurrent_program_id = FCP.concurrent_program_id
AND FCR.program_application_id = FCP.application_id
AND FCP.application_id = 542
AND FCP.concurrent_program_name = 'CSITXIMW'
AND FCR.phase_code IN ('I','P','R');
update csi_batch_txn_lines
set batch_id = -1,last_update_date = sysdate,last_updated_by = fnd_global.user_id
where batch_id = cur_batch.batch_id;
update CSI_BATCH_TXN_LINES
set processed_flag = 1,last_update_date = sysdate,last_updated_by = fnd_global.user_id
where batch_id = cur_batch.batch_id
and processed_flag = 0;
update csi_batch_txn_lines
set batch_id = -1,last_update_date = sysdate,last_updated_by = fnd_global.user_id
where processed_flag = 0;