218:
219: cursor det_tpw_cur is
220: select 'X'
221: from wsh_delivery_details wdd,
222: wsh_delivery_assignments_v wda
223: where wdd.delivery_detail_id = wda.delivery_detail_id
224: and wdd.container_flag='N'
225: and wdd.source_code ='WSH'
226: and wda.delivery_id=p_delivery_id
402:
403: cursor del_cur ( p_source_line_id IN NUMBER ) is
404: select count(*)
405: from wsh_new_deliveries wnd,
406: wsh_delivery_assignments_v wda,
407: wsh_delivery_details wdd
408: where wnd.status_code in ('SR','SC')
409: --and wnd.planned_flag = 'Y'
410: and wda.delivery_id = wnd.delivery_id
591: wnd.status_code,
592: wnd.planned_flag,
593: wnd.delivery_id
594: from wsh_new_deliveries wnd,
595: wsh_delivery_assignments_v wda
596: where wnd.delivery_id = wda.delivery_id
597: and wda.delivery_detail_id = p_del_det_id;
598:
599: cursor del_cur( p_delivery_id IN NUMBER ) is
616:
617: cursor del_to_det_cur( p_delivery_id IN NUMBER ) is
618: select distinct 'X'
619: from wsh_delivery_details wdd,
620: wsh_delivery_assignments_v wda
621: where wda.delivery_id = p_delivery_id
622: and wdd.delivery_detail_id = wda.delivery_detail_id
623: and wdd.source_code = 'WSH'
624: and wdd.container_flag = 'N';
626: --performance fix - no need to join to wnd
627: cursor stop_to_det_cur( p_stop_id IN NUMBER ) is
628: select 'X'
629: from wsh_delivery_details wdd,
630: wsh_delivery_assignments_v wda,
631: wsh_delivery_legs wdl
632: where wdl.pick_up_stop_id = p_stop_id
633: and wda.delivery_id is not null
634: and wda.delivery_id = wdl.delivery_id
640: cursor trip_to_det_cur( p_trip_id IN NUMBER ) is
641: select distinct 'X'
642: from wsh_delivery_details wdd,
643: wsh_new_deliveries wnd,
644: wsh_delivery_assignments_v wda,
645: wsh_delivery_legs wdl,
646: wsh_trip_stops wts1,
647: wsh_trip_stops wts2,
648: wsh_trips wt
659:
660: cursor det_stat_cur( p_delivery_id IN NUMBER) is
661: select distinct 'X'
662: from wsh_delivery_details wdd,
663: wsh_delivery_assignments_v wda
664: where wdd.source_code = 'WSH'
665: and wdd.container_flag = 'N'
666: and wdd.delivery_detail_id = wda.delivery_detail_id
667: and wda.delivery_id = p_delivery_id;