The following lines contain the word 'select', 'insert', 'update' or 'delete':
UPDATE wsh_delivery_details
SET released_status = 'P'
where source_header_id = p_in_rec.header_ids(i)
AND source_code = 'PO'
RETURNING delivery_detail_id BULK COLLECT INTO l_detail_tab;
WSH_INTEGRATION.DBI_Update_Detail_Log
(p_delivery_detail_id_tab => l_detail_tab,
p_dml_type => 'UPDATE',
x_return_status => l_dbi_rs);
SELECT wth.shipment_header_id, wth.last_update_date, wnd.last_update_date
FROM wsh_inbound_txn_history wth, wsh_new_deliveries wnd
WHERE receipt_number like p_respNum
AND shipment_header_id = wnd.delivery_id
AND transaction_type = 'ROUTING_RESPONSE'
ORDER BY NVL(revision_number, -99) DESC;
CURSOR c_GetLastUpdateDates(p_delId NUMBER) IS
SELECT MAX(wda.last_update_date), MAX(wdd.last_update_date)
FROM wsh_delivery_assignments_v wda,wsh_delivery_details wdd
WHERE wdd.delivery_detail_id = wda.delivery_detail_id
AND wda.delivery_id = p_delId;
CURSOR c_GetPTripLastUpdateDate(p_delId NUMBER) IS
SELECT wts.last_update_date, wdl.last_update_date, wt.last_update_date
FROM wsh_new_deliveries wnd,
wsh_delivery_legs wdl,
wsh_trip_stops wts,
wsh_trips wt
WHERE wnd.delivery_id = p_delId
AND wnd.delivery_id = wdl.delivery_id
AND wdl.pick_up_stop_id = wts.stop_id
AND wnd.initial_pickup_location_id = wts.stop_location_id
AND wts.trip_id = wt.trip_id
AND wnd.shipping_control='BUYER';
CURSOR c_GetDTripLastUpdateDate(p_delId NUMBER) IS
SELECT wts.last_update_date, wdl.last_update_date, wt.last_update_date
FROM wsh_new_deliveries wnd,
wsh_delivery_legs wdl,
wsh_trip_stops wts,
wsh_trips wt
WHERE wnd.delivery_id = p_delId
AND wnd.delivery_id = wdl.delivery_id
AND wdl.pick_up_stop_id = wts.stop_id
AND wnd.ultimate_dropoff_location_id = wts.stop_location_id
AND wts.trip_id = wt.trip_id
AND wnd.shipping_control='BUYER';
CURSOR c_GetCarrierLastUpdateDate(p_delId NUMBER) IS
SELECT MAX(wcs.last_update_date), MAX(wocs.last_update_date)
FROM wsh_new_deliveries wnd, wsh_carrier_sites wcs,
wsh_org_carrier_sites wocs
WHERE wnd.organization_id = wocs.organization_id
AND wcs.carrier_id = wnd.carrier_id
AND wnd.delivery_id = p_delId;
l_wndUpdateDate DATE;
l_wdaUpdateDate DATE;
l_wddUpdateDate DATE;
l_wdlUpdateDate DATE;
l_wtsUpdateDate DATE;
l_wtUpdateDate DATE;
l_wdlUpdateDate1 DATE;
l_wtsUpdateDate1 DATE;
l_wtUpdateDate1 DATE;
l_ibUpdateDate DATE;
l_wcsUpdateDate DATE;
l_wocsUpdateDate DATE;
FETCH c_GetDelId INTO l_deliveryId, l_ibUpdateDate, l_wndUpdateDate;
wsh_debug_sv.log(l_module_name, 'last update date in IB TXN history', l_ibUpdateDate);
wsh_debug_sv.log(l_module_name, 'WND Last Update Date', l_wndUpdateDate);
OPEN c_GetLastUpdateDates(l_deliveryId);
FETCH c_GetLastUpdateDates INTO l_wdaUpdateDate, l_wddUpdateDate;
CLOSE c_GetLastUpdateDates;
OPEN c_GetPTripLastUpdateDate(l_deliveryId);
FETCH c_GetPTripLastUpdateDate INTO l_wtsUpdateDate, l_wdlUpdateDate, l_wtUpdateDate;
CLOSE c_GetPTripLastUpdateDate;
OPEN c_GetDTripLastUpdateDate(l_deliveryId);
FETCH c_GetDTripLastUpdateDate INTO l_wtsUpdateDate1, l_wdlUpdateDate1, l_wtUpdateDate1;
CLOSE c_GetDTripLastUpdateDate;
OPEN c_GetCarrierLastUpdateDate(l_deliveryId);
FETCH c_GetCarrierLastUpdateDate INTO l_wcsUpdateDate, l_wocsUpdateDate;
CLOSE c_GetCarrierLastUpdateDate;
wsh_debug_sv.log(l_module_name, 'WND Update Date', l_wndUpdateDate);
wsh_debug_sv.log(l_module_name, 'WDA Update Date', l_wdaUpdateDate);
wsh_debug_sv.log(l_module_name, 'WDD Update Date', l_wddUpdateDate);
wsh_debug_sv.log(l_module_name, 'WTS Update Date using Pickup Stop', l_wtsUpdateDate);
wsh_debug_sv.log(l_module_name, 'WDL Update Date using Pickup Stop', l_wdlUpdateDate);
wsh_debug_sv.log(l_module_name, 'WT Update Date using Pickup Stop', l_wtUpdateDate);
wsh_debug_sv.log(l_module_name, 'WTS Update Date using Dropoff Stop', l_wtsUpdateDate1);
wsh_debug_sv.log(l_module_name, 'WDL Update Date using Dropoff Stop', l_wdlUpdateDate1);
wsh_debug_sv.log(l_module_name, 'WT Update Date using Dropoff Stop', l_wtUpdateDate1);
wsh_debug_sv.log(l_module_name, 'WCS Update Date', l_wcsUpdateDate);
wsh_debug_sv.log(l_module_name, 'WOCS Update Date', l_wocsUpdateDate);
IF l_ibUpdateDate < l_wndUpdateDate OR
l_ibUpdateDate < l_wdaUpdateDate OR
l_ibUpdateDate < l_wddUpdateDate OR
l_ibUpdateDate < l_wtsUpdateDate OR
l_ibUpdateDate < l_wdlUpdateDate OR
l_ibUpdateDate < l_wtUpdateDate OR
l_ibUpdateDate < l_wtsUpdateDate1 OR
l_ibUpdateDate < l_wdlUpdateDate1 OR
l_ibUpdateDate < l_wtUpdateDate1 OR
l_ibUpdateDate < l_wcsUpdateDate OR
l_ibUpdateDate < l_wocsUpdateDate THEN
l_changed := TRUE;
Select wsh_location_id
from wsh_locations
where
source_location_id = p_location_id
and location_source_code = 'HZ';
Select 1
from wsh_delivery_details
where
po_shipment_line_id = p_shipment_line_id
and (ship_from_location_id = p_location_id or ship_from_location_id = -1 )
and released_status = 'X'
and source_code = 'PO'
and source_line_id = p_po_line_id
and rownum=1;
Select 1
from wsh_delivery_details
where
po_shipment_line_id = p_shipment_line_id
and released_status = 'X'
and source_code = 'PO'
and source_line_id = p_po_line_id
and rownum =1;