The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT mmtt.organization_id
, mmtt.transfer_lpn_id
, wdt.task_id
FROM mtl_material_transactions_temp mmtt
, wms_dispatched_tasks wdt
WHERE mmtt.transaction_temp_id = p_temp_id
AND wdt.transaction_temp_id = mmtt.transaction_temp_id;
SELECT 'x'
INTO l_dummy
FROM dual
WHERE EXISTS
( SELECT 'x'
FROM wms_dispatched_tasks_history
WHERE parent_transaction_id = p_parent_temp_id
AND is_parent = 'N'
);
SELECT mtl_material_transactions_s.NEXTVAL
INTO l_txn_header_id
FROM dual;
, p_delete_mmtt_flag => 'Y'
, p_txn_header_id => l_txn_header_id
, p_transfer_lpn_id => parent_rec.transfer_lpn_id
);
UPDATE wms_dispatched_tasks_history wdth
SET wdth.parent_transaction_id = wdth.transaction_id
, wdth.is_parent = 'Y'
WHERE wdth.task_id = parent_rec.task_id
RETURNING wdth.transaction_id INTO l_parent_txn_id;
( 'Updated WDTH. Parent transaction ID is: '
|| to_char(l_parent_txn_id)
, l_api_name
);
UPDATE wms_dispatched_tasks_history wdth
SET wdth.parent_transaction_id = l_parent_txn_id
WHERE wdth.parent_transaction_id = p_parent_temp_id;
( 'Updated WDTH for child records.'
, l_api_name
);
DELETE wms_dispatched_tasks
WHERE transaction_temp_id = p_parent_temp_id;
DELETE mtl_material_transactions_temp
WHERE transaction_temp_id = p_parent_temp_id;