The following lines contain the word 'select', 'insert', 'update' or 'delete':
| PROCEDURE NAME Update_Dlvy_Status |
| |
| DESCRIPTION This procedure is used to update the delivery status |
| appropriately depending on the parameters passed. |
| |
| MODIFICATION HISTORY |
| |
| 02/20/02 Ravikiran Vishnuvajhala Created |
| |
============================================================================*/
--
G_PKG_NAME CONSTANT VARCHAR2(50) := 'WSH_DELIVERY_UTIL';
procedure Update_Dlvy_Status( p_delivery_id IN NUMBER,
p_action_code IN VARCHAR2 ,
p_document_type IN VARCHAR2 ,
x_return_status OUT NOCOPY VARCHAR2
)
IS
--pragma AUTONOMOUS_TRANSACTION;
l_module_name CONSTANT VARCHAR2(100) := 'wsh.plsql.' || G_PKG_NAME || '.' || 'UPDATE_DLVY_STATUS';
wsh_debug_sv.push(l_module_name, 'Update_Dlvy_Status');
update wsh_new_deliveries
set status_code ='OP'
where delivery_id = p_delivery_id
and status_code IN ('SR','SC');
select planned_flag into l_planned_flag
from wsh_new_deliveries
where delivery_id = p_delivery_id;
update wsh_new_deliveries
set status_code ='SR'
where delivery_id = p_delivery_id
and status_code = 'OP';
update wsh_new_deliveries
set status_code ='SA'
where delivery_id = p_delivery_id
and status_code IN ('SR','SC');
update wsh_new_deliveries
set status_code ='SC'
where delivery_id = p_delivery_id
and status_code = 'SR';
END Update_Dlvy_Status;
select status_code, planned_flag
from wsh_new_deliveries
where delivery_id =p_delivery_id;
select 'X'
from wsh_delivery_details wdd,
wsh_delivery_assignments_v wda
where wdd.delivery_detail_id = wda.delivery_detail_id
and wdd.container_flag='N'
and wdd.source_code ='WSH'
and wda.delivery_id=p_delivery_id
and rownum = 1;
select wth.event_key, wth.item_type
from wsh_new_deliveries wnd,
wsh_transactions_history wth
where delivery_id =v_delivery_id
and wnd.name = wth.entity_number
and wth.document_direction = 'O'
and wth.document_type = 'SR'
and wth.action_type = 'A'
and wth.entity_type = 'DLVY'
order by transaction_id desc;
select 'X'
from wsh_transactions_history
where event_key = v_event_key
and item_type = v_item_type
and document_direction = 'I'
and action_type = 'A'
and document_type = 'SA'
order by transaction_id desc;
PROCEDURE Check_Updates_Allowed( p_changed_attributes IN WSH_INTERFACE.ChangedAttributeTabType,
p_source_code IN VARCHAR2,
x_update_allowed OUT NOCOPY VARCHAR2,
x_return_status OUT NOCOPY VARCHAR2)
IS
cursor del_cur ( p_source_line_id IN NUMBER ) is
select count(*)
from wsh_new_deliveries wnd,
wsh_delivery_assignments_v wda,
wsh_delivery_details wdd
where wnd.status_code in ('SR','SC')
--and wnd.planned_flag = 'Y'
and wda.delivery_id = wnd.delivery_id
and wda.delivery_detail_id = wdd.delivery_detail_id
and wdd.container_flag ='N'
and wdd.source_line_id = p_source_line_id
and wdd.source_code = p_source_code;
select organization_id,
delivery_detail_id
from wsh_delivery_details
where source_code= p_source_code
and source_line_id = p_source_line_id
and rownum = 1;
wsh_update_not_allowed EXCEPTION;
l_module_name CONSTANT VARCHAR2(100) := 'wsh.plsql.' || G_PKG_NAME || '.' || 'CHECK_UPDATES_ALLOWED';
wsh_debug_sv.push(l_module_name, 'Check_Updates_Allowed');
raise wsh_update_not_allowed;
x_update_allowed := 'Y';
WHEN wsh_update_not_allowed THEN
x_return_status := WSH_UTIL_CORE.G_RET_STS_ERROR;
FND_MESSAGE.SET_NAME('WSH', 'WSH_UPDATE_NOT_ALLOWED');
x_update_allowed := 'N';
WSH_DEBUG_SV.logmsg(l_module_name,'wsh_update_not_allowed exception has occured.',WSH_DEBUG_SV.C_EXCEP_LEVEL);
WSH_DEBUG_SV.pop(l_module_name,'EXCEPTION:wsh_update_not_allowed');
x_update_allowed := 'N';
x_update_allowed := 'N';
WSH_UTIL_CORE.DEFAULT_HANDLER('WSH_DELIVERY_UTIL.Check_Updates_Allowed',l_module_name);
END Check_Updates_Allowed;
select wnd.organization_id,
wnd.status_code,
wnd.planned_flag,
wnd.delivery_id
from wsh_new_deliveries wnd,
wsh_delivery_legs wdl,
wsh_trip_stops wts1,
wsh_trip_stops wts2,
wsh_trips wt
where wnd.delivery_id = wdl.delivery_id
and wts1.stop_id = wdl.PICK_UP_STOP_ID
and wts2.stop_id = wdl.DROP_OFF_STOP_ID
and wts1.trip_id = wt.trip_id
and wts2.trip_id = wt.trip_id
and wt.trip_id = p_trip_id
and rownum = 1;
select wnd.organization_id,
wnd.status_code,
wnd.planned_flag,
wnd.delivery_id
from wsh_new_deliveries wnd,
wsh_delivery_legs wdl
where wnd.delivery_id = wdl.delivery_id
and wdl.pick_up_stop_id = p_stop_id
and rownum = 1;
select wnd.organization_id,
wnd.status_code,
wnd.planned_flag,
wnd.delivery_id
from wsh_new_deliveries wnd,
wsh_delivery_assignments_v wda
where wnd.delivery_id = wda.delivery_id
and wda.delivery_detail_id = p_del_det_id;
select organization_id,
status_code,
planned_flag
from wsh_new_deliveries
where delivery_id=p_delivery_id;
select organization_id,
source_code,
container_flag
from wsh_delivery_details
where delivery_detail_id = p_del_det_id;
select distinct 'X'
from wsh_delivery_details wdd,
wsh_delivery_assignments_v wda
where wda.delivery_id = p_delivery_id
and wdd.delivery_detail_id = wda.delivery_detail_id
and wdd.source_code = 'WSH'
and wdd.container_flag = 'N';
select 'X'
from wsh_delivery_details wdd,
wsh_delivery_assignments_v wda,
wsh_delivery_legs wdl
where wdl.pick_up_stop_id = p_stop_id
and wda.delivery_id is not null
and wda.delivery_id = wdl.delivery_id
and wdd.delivery_detail_id = wda.delivery_detail_id
and wdd.source_code = 'WSH'
and wdd.container_flag = 'N'
and rownum=1;
select distinct 'X'
from wsh_delivery_details wdd,
wsh_new_deliveries wnd,
wsh_delivery_assignments_v wda,
wsh_delivery_legs wdl,
wsh_trip_stops wts1,
wsh_trip_stops wts2,
wsh_trips wt
where wt.trip_id = p_trip_id
and wts1.trip_id = wt.trip_id
and wts2.trip_id = wt.trip_id
and wts1.stop_id = wdl.pick_up_stop_id
and wts2.stop_id = wdl.drop_off_stop_id
and wnd.delivery_id = wdl.delivery_id
and wda.delivery_id = wnd.delivery_id
and wdd.delivery_detail_id = wda.delivery_detail_id
and wdd.source_code = 'WSH'
and wdd.container_flag = 'N';
select distinct 'X'
from wsh_delivery_details wdd,
wsh_delivery_assignments_v wda
where wdd.source_code = 'WSH'
and wdd.container_flag = 'N'
and wdd.delivery_detail_id = wda.delivery_detail_id
and wda.delivery_id = p_delivery_id;
select 'X'
from wsh_transactions_history
where transaction_id = (
select max(transaction_id)
from wsh_transactions_history wth,
wsh_new_deliveries wnd
where wth.entity_number = wnd.name
and wth.trading_partner_id = p_tp_id
and wnd.delivery_id = p_delivery_id
)
and document_direction='I'
and action_type = 'A';
'UPDATE_STATUS')) THEN
l_entity_ids := x_entity_ids;