347: AND wt.tp_plan_name(+) = wti.tp_plan_name
348: AND wti.group_id in
349: (SELECT wti.group_id FROM wsh_new_del_interface wndi,
350: wsh_del_legs_interface wdli,
351: wsh_trip_stops_interface wtsi,
352: wsh_trips_interface wti,
353: wsh_new_deliveries wnd
354: where wndi.interface_action_code IN (G_TMS_RELEASE_CODE,G_TMS_DELETE_CODE)
355: AND wdli.delivery_interface_id = wndi.delivery_interface_id
476: null attribute12,
477: null attribute13,
478: null attribute14,
479: null attribute15
480: FROM wsh_trip_stops_interface wtsi,
481: wsh_trips_interface wti
482: WHERE wti.group_id = p_group_id --p_group_id is the input parameter
483: AND wtsi.trip_interface_id = wti.trip_interface_id
484: AND wtsi.interface_action_code = G_TMS_RELEASE_CODE
538: null attribute12,
539: null attribute13,
540: null attribute14,
541: null attribute15
542: FROM wsh_trip_stops_interface wtsi,
543: wsh_trips_interface wti
544: WHERE wti.tp_plan_name >= nvl(p_tp_plan_low,wti.tp_plan_name)
545: AND wti.tp_plan_name <= nvl(p_tp_plan_high,wti.tp_plan_name)
546: AND wtsi.trip_interface_id = wti.trip_interface_id
601: null attribute12,
602: null attribute13,
603: null attribute14,
604: null attribute15
605: FROM wsh_trip_stops_interface wtsi,
606: wsh_trips_interface wti
607: WHERE wtsi.trip_interface_id = wti.trip_interface_id
608: AND wtsi.interface_action_code = G_TMS_RELEASE_CODE
609: AND wti.interface_action_code = G_TMS_RELEASE_CODE
609: AND wti.interface_action_code = G_TMS_RELEASE_CODE
610: AND wti.group_id in
611: (SELECT wti.group_id FROM wsh_new_del_interface wndi,
612: wsh_del_legs_interface wdli,
613: wsh_trip_stops_interface wtsi,
614: wsh_trips_interface wti,
615: wsh_new_deliveries wnd
616: where wndi.interface_action_code IN (G_TMS_RELEASE_CODE,G_TMS_DELETE_CODE)
617: AND wdli.delivery_interface_id = wndi.delivery_interface_id
678: null attribute12,
679: null attribute13,
680: null attribute14,
681: null attribute15
682: FROM wsh_trip_stops_interface wtsi,
683: wsh_trips_interface wti
684: WHERE wtsi.trip_interface_id = wti.trip_interface_id
685: AND wtsi.interface_action_code = G_TMS_RELEASE_CODE
686: AND wti.interface_action_code = G_TMS_RELEASE_CODE
710: 'N' processed_flag, -- used to indicate which deliveries have to be assigned
711: wnd.tms_interface_flag -- used to check whether tms version check can be avoided.
712: FROM wsh_del_legs_interface wdli,
713: wsh_new_del_interface wndi,
714: wsh_trip_stops_interface wtsi_pu,
715: wsh_trip_stops_interface wtsi_do,
716: wsh_trips_interface wti,
717: wsh_new_deliveries wnd
718: WHERE wti.group_id = p_group_id --p_group_id is the input parameter
711: wnd.tms_interface_flag -- used to check whether tms version check can be avoided.
712: FROM wsh_del_legs_interface wdli,
713: wsh_new_del_interface wndi,
714: wsh_trip_stops_interface wtsi_pu,
715: wsh_trip_stops_interface wtsi_do,
716: wsh_trips_interface wti,
717: wsh_new_deliveries wnd
718: WHERE wti.group_id = p_group_id --p_group_id is the input parameter
719: AND wti.interface_action_code = G_TMS_RELEASE_CODE
757: 'N' processed_flag, -- used to indicate which deliveries have to be assigned
758: wnd.tms_interface_flag -- used to check whether tms version check can be avoided.
759: FROM wsh_del_legs_interface wdli,
760: wsh_new_del_interface wndi,
761: wsh_trip_stops_interface wtsi_pu,
762: wsh_trip_stops_interface wtsi_do,
763: wsh_trips_interface wti,
764: wsh_new_deliveries wnd
765: WHERE wti.tp_plan_name >= nvl(p_tp_plan_low,wti.tp_plan_name)
758: wnd.tms_interface_flag -- used to check whether tms version check can be avoided.
759: FROM wsh_del_legs_interface wdli,
760: wsh_new_del_interface wndi,
761: wsh_trip_stops_interface wtsi_pu,
762: wsh_trip_stops_interface wtsi_do,
763: wsh_trips_interface wti,
764: wsh_new_deliveries wnd
765: WHERE wti.tp_plan_name >= nvl(p_tp_plan_low,wti.tp_plan_name)
766: AND wti.tp_plan_name <= nvl(p_tp_plan_high,wti.tp_plan_name)
805: 'N' processed_flag, -- used to indicate which deliveries have to be assigned
806: wnd.tms_interface_flag -- used to check whether tms version check can be avoided.
807: FROM wsh_del_legs_interface wdli,
808: wsh_new_del_interface wndi,
809: wsh_trip_stops_interface wtsi_pu,
810: wsh_trip_stops_interface wtsi_do,
811: wsh_trips_interface wti,
812: wsh_new_deliveries wnd
813: WHERE wti.interface_action_code = G_TMS_RELEASE_CODE
806: wnd.tms_interface_flag -- used to check whether tms version check can be avoided.
807: FROM wsh_del_legs_interface wdli,
808: wsh_new_del_interface wndi,
809: wsh_trip_stops_interface wtsi_pu,
810: wsh_trip_stops_interface wtsi_do,
811: wsh_trips_interface wti,
812: wsh_new_deliveries wnd
813: WHERE wti.interface_action_code = G_TMS_RELEASE_CODE
814: AND wtsi_pu.trip_interface_id = wti.trip_interface_id
823: AND wdli.interface_action_code = G_TMS_RELEASE_CODE
824: AND wti.group_id in
825: (SELECT wti.group_id FROM wsh_new_del_interface wndi,
826: wsh_del_legs_interface wdli,
827: wsh_trip_stops_interface wtsi,
828: wsh_trips_interface wti,
829: wsh_new_deliveries wnd
830: where wndi.interface_action_code IN (G_TMS_RELEASE_CODE,G_TMS_DELETE_CODE)
831: AND wdli.delivery_interface_id = wndi.delivery_interface_id
862: 'N' processed_flag, -- used to indicate which deliveries have to be assigned
863: wnd.tms_interface_flag -- used to check whether tms version check can be avoided.
864: FROM wsh_del_legs_interface wdli,
865: wsh_new_del_interface wndi,
866: wsh_trip_stops_interface wtsi_pu,
867: wsh_trip_stops_interface wtsi_do,
868: wsh_trips_interface wti,
869: wsh_new_deliveries wnd
870: WHERE wti.interface_action_code = G_TMS_RELEASE_CODE
863: wnd.tms_interface_flag -- used to check whether tms version check can be avoided.
864: FROM wsh_del_legs_interface wdli,
865: wsh_new_del_interface wndi,
866: wsh_trip_stops_interface wtsi_pu,
867: wsh_trip_stops_interface wtsi_do,
868: wsh_trips_interface wti,
869: wsh_new_deliveries wnd
870: WHERE wti.interface_action_code = G_TMS_RELEASE_CODE
871: AND wtsi_pu.trip_interface_id = wti.trip_interface_id
999: wdli.delivery_leg_interface_id,
1000: wtsi.stop_interface_id,
1001: wfci.freight_cost_interface_id
1002: from wsh_trips_interface wti ,
1003: wsh_trip_stops_interface wtsi ,
1004: wsh_del_legs_interface wdli ,
1005: wsh_freight_costs_interface wfci,
1006: wsh_new_del_interface wndi
1007: where wti.trip_interface_id = c_trip_interface_id --Bug7717569
1379: DELETE from wsh_interface_errors wie
1380: WHERE wie.interface_table_name = 'WSH_NEW_DEL_INTERFACE'
1381: AND wie.interface_id in (
1382: select wdli.delivery_interface_id
1383: from wsh_trip_stops_interface wtsi,
1384: wsh_del_legs_interface wdli
1385: where wtsi.trip_interface_id = l_del_wti_tab(i)
1386: and wtsi.stop_interface_id = wdli.pick_up_stop_interface_id
1387: and wtsi.interface_action_code = G_TMS_RELEASE_CODE
1392: FORALL i in l_del_wti_tab.FIRST..l_del_wti_tab.LAST
1393: DELETE from WSH_EXCEPTIONS we
1394: WHERE we.delivery_id in (
1395: select wdli.delivery_id
1396: from wsh_trip_stops_interface wtsi,
1397: wsh_del_legs_interface wdli
1398: where wtsi.trip_interface_id = l_del_wti_tab(i)
1399: and wtsi.stop_interface_id = wdli.pick_up_stop_interface_id
1400: and wtsi.interface_action_code = G_TMS_RELEASE_CODE
2573: SELECT wtsi.dock_name, wnd.organization_id, wtsi.start_time, wtsi.end_time
2574: FROM wsh_del_legs_interface wdli,
2575: wsh_new_del_interface wndi,
2576: wsh_new_deliveries wnd,
2577: wsh_trip_stops_interface wtsi,
2578: wsh_trips_interface wti
2579: WHERE wti.group_id = c_group_id
2580: AND wti.interface_action_code = G_TMS_RELEASE_CODE
2581: AND wtsi.trip_interface_id = wti.trip_interface_id
4176: -- Corrections Form)
4177: -- Purge any records in wsh_interface_errors
4178: -- Purge records in wsh_new_del_interface
4179: -- Purge records in wsh_del_legs_interface
4180: -- Purge records in wsh_trip_stops_interface
4181: -- Purge records in wsh_trips_interface
4182: -- Index exists on group_id and trip_interface_id of wsh_trips_interface,
4183: -- so use trip_interface_id.
4184: --
4258: FORALL i in l_trip_interface_id_tab.FIRST..l_trip_interface_id_tab.LAST
4259: Delete from wsh_freight_costs_interface wfci
4260: where wfci.delivery_interface_id in (
4261: select wdli.delivery_interface_id
4262: from wsh_trip_stops_interface wtsi,
4263: wsh_del_legs_interface wdli
4264: where wtsi.trip_interface_id = l_trip_interface_id_tab(i)
4265: and wtsi.stop_interface_id = wdli.pick_up_stop_interface_id
4266: and wtsi.interface_action_code = G_TMS_RELEASE_CODE
4276: FORALL i in l_trip_interface_id_tab.FIRST..l_trip_interface_id_tab.LAST
4277: DELETE from WSH_EXCEPTIONS we
4278: WHERE we.delivery_id in (
4279: select wdli.delivery_id
4280: from wsh_trip_stops_interface wtsi,
4281: wsh_del_legs_interface wdli
4282: where wtsi.trip_interface_id = l_trip_interface_id_tab(i)
4283: and wtsi.stop_interface_id = wdli.pick_up_stop_interface_id
4284: and wtsi.interface_action_code = G_TMS_RELEASE_CODE
4295: UPDATE WSH_EXCEPTIONS we
4296: SET status = 'CLOSED'
4297: WHERE we.delivery_id in (
4298: select wdli.delivery_id
4299: from wsh_trip_stops_interface wtsi,
4300: wsh_del_legs_interface wdli
4301: where wtsi.trip_interface_id = l_trip_interface_id_tab(i)
4302: and wtsi.stop_interface_id = wdli.pick_up_stop_interface_id
4303: and wtsi.interface_action_code = G_TMS_RELEASE_CODE
4307: END IF;--}
4308:
4309: -- Purge wsh_interface_errors
4310: -- for each of the above entity, there could be errors logged in wsh_interface_errors
4311: -- table_name can be WSH_NEW_DEL_INTERFACE, WSH_TRIP_STOPS_INTERFACE,
4312: -- WSH_TRIPS_INTERFACE
4313:
4314: IF l_debug_on THEN
4315: WSH_DEBUG_SV.logmsg(l_module_name,'Start Purging Interface Errors Data for delivery');
4319: Delete from wsh_interface_errors wie
4320: where wie.interface_table_name = 'WSH_NEW_DEL_INTERFACE'
4321: and wie.interface_id in (
4322: select wdli.delivery_interface_id
4323: from wsh_trip_stops_interface wtsi,
4324: wsh_del_legs_interface wdli
4325: where wtsi.trip_interface_id = l_trip_interface_id_tab(i)
4326: and wtsi.stop_interface_id = wdli.pick_up_stop_interface_id
4327: and wtsi.interface_action_code = G_TMS_RELEASE_CODE
4333: END IF;
4334: -- Delete errors logged for trip stops
4335: FORALL i in l_trip_interface_id_tab.FIRST..l_trip_interface_id_tab.LAST
4336: Delete from wsh_interface_errors wie
4337: where wie.interface_table_name = 'WSH_TRIP_STOPS_INTERFACE'
4338: and wie.interface_id in (
4339: select wtsi.stop_interface_id
4340: from wsh_trip_stops_interface wtsi
4341: where wtsi.trip_interface_id = l_trip_interface_id_tab(i)
4336: Delete from wsh_interface_errors wie
4337: where wie.interface_table_name = 'WSH_TRIP_STOPS_INTERFACE'
4338: and wie.interface_id in (
4339: select wtsi.stop_interface_id
4340: from wsh_trip_stops_interface wtsi
4341: where wtsi.trip_interface_id = l_trip_interface_id_tab(i)
4342: and wtsi.interface_action_code = G_TMS_RELEASE_CODE)
4343: and wie.interface_action_code = G_TMS_RELEASE_CODE;
4344:
4359: FORALL i in l_trip_interface_id_tab.FIRST..l_trip_interface_id_tab.LAST
4360: Delete from wsh_new_del_interface wndi
4361: where wndi.delivery_interface_id in (
4362: select wdli.delivery_interface_id
4363: from wsh_trip_stops_interface wtsi,
4364: wsh_del_legs_interface wdli
4365: where wtsi.trip_interface_id = l_trip_interface_id_tab(i)
4366: and wtsi.stop_interface_id = wdli.pick_up_stop_interface_id
4367: and wtsi.interface_action_code = G_TMS_RELEASE_CODE
4375: FORALL i in l_trip_interface_id_tab.FIRST..l_trip_interface_id_tab.LAST
4376: Delete from wsh_del_legs_interface wdli
4377: where wdli.pick_up_stop_interface_id in (
4378: select wtsi.stop_interface_id
4379: from wsh_trip_stops_interface wtsi
4380: where wtsi.trip_interface_id = l_trip_interface_id_tab(i)
4381: and wtsi.interface_action_code = G_TMS_RELEASE_CODE)
4382: and wdli.interface_action_code = G_TMS_RELEASE_CODE;
4383:
4380: where wtsi.trip_interface_id = l_trip_interface_id_tab(i)
4381: and wtsi.interface_action_code = G_TMS_RELEASE_CODE)
4382: and wdli.interface_action_code = G_TMS_RELEASE_CODE;
4383:
4384: -- Purge wsh_trip_stops_interface
4385: IF l_debug_on THEN
4386: WSH_DEBUG_SV.logmsg(l_module_name,'Start Purging Trip Stops Interface Data');
4387: END IF;
4388: FORALL i in l_trip_interface_id_tab.FIRST..l_trip_interface_id_tab.LAST
4385: IF l_debug_on THEN
4386: WSH_DEBUG_SV.logmsg(l_module_name,'Start Purging Trip Stops Interface Data');
4387: END IF;
4388: FORALL i in l_trip_interface_id_tab.FIRST..l_trip_interface_id_tab.LAST
4389: Delete from wsh_trip_stops_interface wtsi
4390: where wtsi.trip_interface_id = l_trip_interface_id_tab(i)
4391: and wtsi.interface_action_code = G_TMS_RELEASE_CODE;
4392:
4393: -- Purge wsh_trips_interface