The following lines contain the word 'select', 'insert', 'update' or 'delete':
select 'X'
from wsh_wms_sync_tmp
WHERE delivery_detail_id = p_del_det_id
AND operation_type= p_opn_type
AND creation_date = l_hw_date;
IF (p_sync_tmp_rec.operation_type IN ('UPDATE', 'PRIOR')) THEN
--{
--
/*
MERGE INTO WSH_WMS_SYNC_TMP T
USING (SELECT delivery_detail_id
FROM WSH_WMS_SYNC_TMP
WHERE delivery_detail_id = p_sync_tmp_rec.delivery_detail_id
AND operation_type= p_sync_tmp_rec.operation_type
AND creation_date > WSH_WMS_LPN_GRP.G_HW_TIME_STAMP) S
ON (T.delivery_detail_id = S.delivery_detail_id)
WHEN MATCHED THEN
UPDATE
SET T.temp_col = null
WHEN NOT MATCHED THEN
INSERT (T.delivery_detail_id,
T.parent_delivery_detail_id,
T.delivery_id,
T.operation_type,
T.creation_date)
VALUES (p_sync_tmp_rec.delivery_detail_id,
p_sync_tmp_rec.parent_delivery_detail_id,
p_sync_tmp_rec.delivery_id,
p_sync_tmp_rec.operation_type,
sysdate);
insert into WSH_WMS_SYNC_TMP
(delivery_detail_id,
parent_delivery_detail_id,
delivery_id,
operation_type,
creation_date,
call_level)
values (p_sync_tmp_rec.delivery_detail_id,
p_sync_tmp_rec.parent_delivery_detail_id,
p_sync_tmp_rec.delivery_id,
p_sync_tmp_rec.operation_type,
WSH_WMS_LPN_GRP.G_HW_TIME_STAMP,
p_sync_tmp_rec.call_level);
WSH_DEBUG_SV.logmsg(l_module_name, 'INSERTED '||SQL%ROWCOUNT||' RECORDS IN WSH_WMS_SYNC_TMP' );
select 'X'
from wsh_wms_sync_tmp
WHERE delivery_detail_id = p_del_det_id
AND operation_type= p_opn_type
AND creation_date = l_hw_date;
IF (l_operation_type = 'UPDATE') THEN
--{
FORALL i in l_first..l_last
MERGE into WSH_WMS_SYNC_TMP T
USING ( SELECT delivery_detail_id
FROM WSH_WMS_SYNC_TMP
WHERE delivery_detail_id = p_sync_tmp_recTbl.delivery_detail_id_tbl(i)
AND operation_type= p_sync_tmp_recTbl.operation_type_tbl(i)
AND creation_date > WSH_WMS_LPN_GRP.G_HW_TIME_STAMP) S
on (T.delivery_detail_id = S.delivery_detail_id)
WHEN MATCHED THEN
UPDATE
SET T.temp_col = null
WHEN NOT MATCHED THEN
INSERT (T.delivery_detail_id,
T.parent_delivery_detail_id,
T.delivery_id,
T.operation_type,
T.creation_date)
VALUES (p_sync_tmp_recTbl.delivery_detail_id_tbl(i),
NULL,
NULL,
l_operation_type,
sysdate);
USING ( SELECT delivery_detail_id
FROM WSH_WMS_SYNC_TMP
WHERE delivery_detail_id = p_sync_tmp_recTbl.delivery_detail_id_tbl(i)
AND operation_type= p_sync_tmp_recTbl.operation_type_tbl(i)
AND creation_date > WSH_WMS_LPN_GRP.G_HW_TIME_STAMP) S
on (T.delivery_detail_id = S.delivery_detail_id)
WHEN MATCHED THEN
UPDATE
SET T.temp_col = null
WHEN NOT MATCHED THEN
INSERT (T.delivery_detail_id,
T.parent_delivery_detail_id,
T.delivery_id,
T.operation_type,
T.creation_date)
VALUES (p_sync_tmp_recTbl.delivery_detail_id_tbl(i),
p_sync_tmp_recTbl.parent_detail_id_tbl(i),
p_sync_tmp_recTbl.delivery_id_tbl(i),
l_operation_type,
sysdate);
insert into WSH_WMS_SYNC_TMP
(delivery_detail_id,
parent_delivery_detail_id,
delivery_id,
operation_type,
creation_date)
VALUES (l_sync_tmp_recTbl.delivery_detail_id_tbl(i),
l_sync_tmp_recTbl.parent_detail_id_tbl(i),
l_sync_tmp_recTbl.delivery_id_tbl(i),
l_operation_type,
WSH_WMS_LPN_GRP.G_HW_TIME_STAMP);
WSH_DEBUG_SV.logmsg(l_module_name, 'INSERTED '||SQL%ROWCOUNT||' RECORDS IN WSH_WMS_SYNC_TMP - 1' );
ELSIF (l_operation_type = 'UPDATE') THEN
--
FORALL i in l_sync_tmp_recTbl.delivery_detail_id_tbl.first..l_sync_tmp_recTbl.delivery_detail_id_tbl.last
insert into WSH_WMS_SYNC_TMP
(delivery_detail_id,
parent_delivery_detail_id,
delivery_id,
operation_type,
creation_date,
call_level)
VALUES (l_sync_tmp_recTbl.delivery_detail_id_tbl(i),
NULL,
NULL,
l_operation_type,
WSH_WMS_LPN_GRP.G_HW_TIME_STAMP,
l_sync_tmp_recTbl.call_level(i));
WSH_DEBUG_SV.logmsg(l_module_name, 'INSERTED '||SQL%ROWCOUNT||' RECORDS IN WSH_WMS_SYNC_TMP - 1' );