The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT trans_id
, line_id
, line_detail_id
, item_id
, lot_id
, whse_code
, orgn_code
, location
FROM ic_tran_pnd ictran
WHERE ictran.doc_type = 'OMSO'
AND ictran.delete_mark = 0
AND ictran.staged_ind = 1 -- only for staged wdds, others lot_number is null
AND abs(ictran.trans_qty) > 0
AND (ictran.lot_id >0 )
;
, p_context => 'LOT_NUMBER_UPDATES'
);
/* update wdd with the new lot_number */
/* if the API get_odm_lot can not get the odm lot number, these wdds would not be updated */
if (l_odm_lot_number is not null) and nvl(l_wdd_id, 0) <> 0 then
Update wsh_delivery_details
set lot_number = l_odm_lot_number
where delivery_detail_id = l_wdd_id
and lot_number is not null
;
GMI_RESERVATION_UTIL.println('update wdd successful id '||l_wdd_id);
, p_context => 'LOT_NUMBER_UPDATES'
);