357: --get the trip if any associated with the delivery
358: begin
359: select wts.trip_id
360: into l_trip_id
361: from wsh_delivery_legs wdl, wsh_trip_stops wts
362: where wdl.delivery_id = l_delivery_id
363: and wdl.pick_up_stop_id = wts.stop_id;
364: EXCEPTION
365: WHEN no_data_found THEN
422: from
423: wms_license_plate_numbers lpn,
424: wms_license_plate_numbers wlpn,
425: wsh_new_deliveries wnd,
426: wsh_delivery_legs wdl,
427: wsh_delivery_details wdd,
428: wsh_delivery_assignments_v wda,
429: wsh_delivery_details wdd2,
430: wsh_trip_stops pickup_stop,