The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT csii.inst_interface_id,
csii.instance_id,
csii.quantity ,
csii.location_id ,
csii.location_type_code
FROM csi_instance_interface csii
WHERE process_status = 'R'
AND source_system_name = nvl(p_source_system_name,source_system_name)
AND EXISTS ( SELECT 1 FROM csi_i_asset_interface csiai
WHERE csiai.inst_interface_id = csii.inst_interface_id )
AND syncup_family IS NULL;
UPDATE csi_instance_interface
SET syncup_family = NULL
WHERE source_system_name = nvl(p_source_system_name,source_system_name)
AND syncup_family is not null
AND process_status = 'R';
UPDATE csi_i_asset_interface
SET fa_sync_flag = 'N'
WHERE inst_interface_id = l_inst_intr_tbl(i_asst)
AND fa_sync_flag = 'Y' ;
UPDATE csi_instance_interface csii
SET syncup_family = l_syncup_family_seq,
process_status = NVL(l_process_status ,csii.process_status),
error_text = DECODE(l_process_status,'E',l_Asset_Error_text,
error_text)
WHERE inst_interface_id = l_inst_intr_tbl(i_asst);
l_inst_intr_tbl.delete;
l_instance_sync_tbl.delete;
l_instance_asset_sync_tbl.delete;
l_fa_asset_sync_tbl.delete;
SELECT inst_interface_id
FROM csi_instance_interface
WHERE process_status='P'
AND source_system_name = nvl(p_source_system_name,source_system_name); --included for bug5949328
UPDATE csi_instance_interface cii
SET process_status = 'R'
WHERE (NVL(cii.batch_name,'$CSI_NULL_VALUE$')=NVL(p_batch_name,cii.batch_name)
OR NVL(cii.batch_name,'$CSI_NULL_VALUE$')=NVL(p_batch_name,'$CSI_NULL_VALUE$'))
AND cii.source_system_name = p_source_system_name
AND cii.process_Status = 'E';
DELETE FROM CSI_INSTANCE_INTERFACE
WHERE inst_interface_id=inst_intf_id_del(i1)
AND source_system_name = nvl(p_source_system_name,source_system_name); --included for bug5949328
DELETE FROM CSI_I_PARTY_INTERFACE cipi
WHERE inst_interface_id=inst_intf_id_del(i1);
DELETE FROM CSI_I_ASSET_INTERFACE
WHERE inst_interface_id=inst_intf_id_del(i1);
DELETE FROM CSI_IEA_VALUE_INTERFACE
WHERE inst_interface_id=inst_intf_id_del(i1);
DELETE FROM CSI_II_RELATION_INTERFACE
WHERE subject_interface_id=inst_intf_id_del(i1)
AND source_system_name = nvl(p_source_system_name,source_system_name); --included for bug5949328
DELETE FROM CSI_II_RELATION_INTERFACE
WHERE object_interface_id=inst_intf_id_del(i1)
AND source_system_name = nvl(p_source_system_name,source_system_name); --included for bug5949328
SELECT inst_interface_id,parallel_worker_id
FROM csi_instance_interface
WHERE parallel_worker_id = pc_worker_id
AND process_status = 'R'
AND source_system_name = nvl(p_source_system_name,source_system_name);
SELECT distinct parallel_worker_id
FROM csi_instance_interface
WHERE process_status = 'R'
AND source_system_name = nvl(p_source_system_name,source_system_name) --included for bug5949328
AND parallel_worker_id IS NOT NULL
AND transaction_identifier IS NULL;
select serial_number
from csi_instance_interface
where source_system_name = nvl(p_source_system_name,source_system_name)
and serial_number is not null
and process_status = 'R'
group by serial_number
having count(*) > 1;
SELECT distinct parallel_worker_id
FROM csi_ii_relation_interface
WHERE process_status = 'R'
AND source_system_name = nvl(p_source_system_name,source_system_name) --included for bug5949328
AND parallel_worker_id IS NOT NULL
AND transaction_identifier IS NULL;
l_insert_count NUMBER :=0;
l_update_count NUMBER :=0;
SELECT inst_interface_id
FROM csi_instance_interface
WHERE process_status='P'
AND source_system_name = nvl(p_source_system_name,source_system_name); --included for bug5949328
SELECT COUNT(*)
INTO l_old_error
FROM csi_instance_interface
WHERE process_status='E'
AND source_system_name = nvl(p_source_system_name,source_system_name); --included for bug5949328
DELETE FROM CSI_INSTANCE_INTERFACE
WHERE inst_interface_id=inst_intf_id_del(i1)
AND source_system_name = nvl(p_source_system_name,source_system_name); --included for bug5949328;
DELETE FROM CSI_I_PARTY_INTERFACE cipi
WHERE inst_interface_id=inst_intf_id_del(i1);
DELETE FROM CSI_I_ASSET_INTERFACE
WHERE inst_interface_id=inst_intf_id_del(i1);
DELETE FROM CSI_IEA_VALUE_INTERFACE
WHERE inst_interface_id=inst_intf_id_del(i1);
DELETE FROM CSI_II_RELATION_INTERFACE
WHERE subject_interface_id=inst_intf_id_del(i1)
AND source_system_name = nvl(p_source_system_name,source_system_name); --included for bug5949328;;
DELETE FROM CSI_II_RELATION_INTERFACE
WHERE object_interface_id=inst_intf_id_del(i1)
AND source_system_name = nvl(p_source_system_name,source_system_name); --included for bug5949328;;
l_srl_tbl.DELETE;
UPDATE CSI_INSTANCE_INTERFACE
set parallel_worker_id = 1
where serial_number = l_srl_tbl(j)
and source_system_name = nvl(p_source_system_name,source_system_name)
and process_status = 'R';
SELECT ceil(count(1)/l_worker_count)
INTO x_count
FROM csi_instance_interface
WHERE trunc(source_transaction_date) BETWEEN
nvl(l_txn_from_date,trunc(source_transaction_date)) AND
nvl(l_txn_to_date,trunc(source_transaction_date))
AND transaction_identifier IS NULL
AND process_status = 'R'
AND source_system_name = nvl(p_source_system_name,source_system_name)
AND parallel_worker_id = -1;
UPDATE csi_instance_interface
SET parallel_worker_id = l_count
WHERE rownum <= x_count
AND parallel_worker_id = -1
AND source_system_name = nvl(p_source_system_name,source_system_name) --Added for bug 3621991
AND process_status = 'R'; --Added for bug 3621991
l_inst_id_tbl.delete;
SELECT COUNT(*)
INTO l_rel_count
FROM csi_ii_relation_interface
WHERE process_status = 'R'
AND source_system_name = nvl(p_source_system_name,source_system_name) --included for bug5949328;
SELECT ceil(count(1)/l_r_worker_count)
INTO x_r_count
FROM csi_ii_relation_interface
WHERE trunc(source_transaction_date) BETWEEN
nvl(l_txn_from_date,trunc(source_transaction_date)) AND
nvl(l_txn_to_date,trunc(source_transaction_date))
AND transaction_identifier IS NULL
AND process_status = 'R'
AND source_system_name = nvl(p_source_system_name,source_system_name)
AND parallel_worker_id = -1;
UPDATE csi_ii_relation_interface
SET parallel_worker_id = l_r_count
WHERE ROWNUM <= x_r_count
AND parallel_worker_id = -1
AND source_system_name = nvl(p_source_system_name,source_system_name)
AND process_status = 'R';
SELECT COUNT(*)
INTO l_rel_count
FROM csi_ii_relation_interface
WHERE process_status = 'R'
AND source_system_name = nvl(p_source_system_name,source_system_name); --included for bug5949328
SELECT COUNT(*)
INTO l_valid_count
FROM csi_ii_relation_interface
WHERE process_status = 'V'
AND source_system_name = nvl(p_source_system_name,source_system_name); --included for bug5949328
SELECT COUNT(*)
INTO l_update_count
FROM csi_ii_relation_interface
WHERE process_status = 'U'
AND source_system_name = nvl(p_source_system_name,source_system_name); --included for bug5949328
l_update_count :=0;
SELECT COUNT(*)
INTO l_insert_count
FROM csi_ii_relation_interface
WHERE process_status = 'I'
AND source_system_name = nvl(p_source_system_name,source_system_name); --included for bug5949328
l_insert_count :=0;
FND_File.Put_Line(Fnd_File.LOG,'Value of l_insert_count is: '||l_insert_count);
AND l_update_count = 0
AND l_insert_count = 0 )
THEN
IF(l_debug_level>1) THEN
FND_File.Put_Line(Fnd_File.LOG,'Values for l_rel_count l_valid_count l_update_count and l_insert_count are zero');
SELECT COUNT(*)
INTO l_new_error
FROM csi_instance_interface
WHERE process_status='E'
AND source_system_name = nvl(p_source_system_name,source_system_name); --included for bug5949328
SELECT ceil(count(1)/l_r_worker_count)
INTO x_r_count
FROM csi_ii_relation_interface
WHERE trunc(source_transaction_date) BETWEEN
nvl(l_txn_from_date,trunc(source_transaction_date)) AND
nvl(l_txn_to_date,trunc(source_transaction_date))
AND transaction_identifier IS NULL
AND process_status = 'R'
AND source_system_name = nvl(p_source_system_name,source_system_name)
AND parallel_worker_id = -1;
UPDATE csi_ii_relation_interface
SET parallel_worker_id = l_r_count
WHERE ROWNUM <= x_r_count
AND parallel_worker_id = -1
AND source_system_name = nvl(p_source_system_name,source_system_name)
AND process_status = 'R';
SELECT COUNT(DISTINCT(parallel_worker_id))
INTO l_r_worker_count
FROM csi_ii_relation_interface
WHERE process_status='V'
AND source_system_name = nvl(p_source_system_name,source_system_name); --included for bug5949328
FND_File.Put_Line(Fnd_File.LOG,'Start time in update mode: '||to_char(sysdate,'dd-mon-yy hh24:mi:ss'));
,'UPDATE'
,l_count
,p_txn_from_date
,p_txn_to_date
,p_source_system_name
);
FND_File.Put_Line(Fnd_File.LOG,'End time in update mode: '||to_char(sysdate,'dd-mon-yy hh24:mi:ss'));
ELSIF l_update_count <> 0
THEN
SELECT COUNT(DISTINCT(parallel_worker_id))
INTO l_r_worker_count
FROM csi_ii_relation_interface
WHERE process_status='U'
AND source_system_name = nvl(p_source_system_name,source_system_name); --included for bug5949328;
FND_File.Put_Line(Fnd_File.LOG,'Before submit request for l_update_count <> 0: ');
FND_File.Put_Line(Fnd_File.LOG,'Start time in update mode: '||to_char(sysdate,'dd-mon-yy hh24:mi:ss'));
,'RE-UPDATE'
,l_count
,p_txn_from_date
,p_txn_to_date
,p_source_system_name
);
FND_File.Put_Line(Fnd_File.LOG,'End time in update mode: '||to_char(sysdate,'dd-mon-yy hh24:mi:ss'));
req_data:=to_char(l_update_count);
ELSIF l_insert_count <> 0
THEN
SELECT COUNT(DISTINCT(parallel_worker_id))
INTO l_r_worker_count
FROM csi_ii_relation_interface
WHERE process_status='I'
AND source_system_name = nvl(p_source_system_name,source_system_name); --included for bug5949328;
FND_File.Put_Line(Fnd_File.LOG,'Before submit request for l_insert_count <> 0: ');
FND_File.Put_Line(Fnd_File.LOG,'Start time in insert mode: '||to_char(sysdate,'dd-mon-yy hh24:mi:ss'));
,'INSERT'
,l_count
,p_txn_from_date
,p_txn_to_date
,p_source_system_name
);
FND_File.Put_Line(Fnd_File.LOG,'End time in insert mode: '||to_char(sysdate,'dd-mon-yy hh24:mi:ss'));
req_data:=to_char(l_insert_count);