DBA Data[Home] [Help]

VIEW: APPS.MST_ACT_OPP_DELIVERY_V

Source

View Text - Preformatted

SELECT mt.plan_id , mt.trip_id , mt.carrier_id , md.delivery_id , mt.mode_of_transport , mt.origin_location_id , mt.destination_location_id , flp1.facility_id , flp2.facility_id , mt.trip_number , substr(mst_wb_util.get_name(mt.origin_location_id),1,80) , wl1.city , wl1.state , wl1.postal_code , wl1.country , substr(mst_wb_util.get_name(mt.destination_location_id),1,80) , wl2.city , wl2.state , wl2.postal_code , wl2.country , wc.freight_code , wlk.meaning , msikfv.concatenated_segments , mt.peak_weight_utilization * 100 , mt.peak_volume_utilization * 100 , mt.peak_pallet_utilization * 100 , nvl((MST_AGG_PKG.GET_TOTAL_TRIP_VOLUME(mt.plan_id, mt.trip_id) + nvl(md.volume, 0))/decode(nvl(mt.effective_vol_capacity, 1), 0, 1, nvl(mt.effective_vol_capacity, 1)), 0) * 100 from mst_trips mt, mst_deliveries md, wsh_locations wl1, wsh_locations wl2, fte_location_parameters flp1, fte_location_parameters flp2, fte_vehicle_types fvt, mtl_system_items_kfv msikfv, wsh_lookups wlk, wsh_carriers wc WHERE mt.planned_flag <> 1 and mt.origin_location_id = wl1.wsh_location_id and wl1.wsh_location_id = flp1.location_id and mt.destination_location_id = wl2.wsh_location_id and wl2.wsh_location_id = flp2.location_id and mt.carrier_id = wc.carrier_id and mt.vehicle_type_id = fvt.vehicle_type_id (+) and fvt.organization_id = msikfv.organization_id (+) and fvt.inventory_item_id = msikfv.inventory_item_id (+) and mt.service_level = wlk.lookup_code and wlk.lookup_type = 'WSH_SERVICE_LEVELS' and md.plan_id = mt.plan_id and mt.mode_of_transport = 'TRUCK' union all select mt.plan_id , mt.trip_id , mt.carrier_id , md.delivery_id , mt.mode_of_transport , mt.origin_location_id , mt.destination_location_id , flp1.facility_id , flp2.facility_id , mt.trip_number , substr(mst_wb_util.get_name(mt.origin_location_id),1,80) , wl1.city , wl1.state , wl1.postal_code , wl1.country , substr(mst_wb_util.get_name(mt.destination_location_id),1,80) , wl2.city , wl2.state , wl2.postal_code , wl2.country , wc.freight_code , wlk.meaning , msikfv.concatenated_segments , mt.peak_weight_utilization * 100 , mt.peak_volume_utilization * 100 , mt.peak_pallet_utilization * 100 , nvl((MST_AGG_PKG.GET_TOTAL_TRIP_VOLUME(mt.plan_id, mt.trip_id) + nvl(md.volume, 0))/decode(nvl(mt.effective_vol_capacity, 1), 0, 1, nvl(mt.effective_vol_capacity, 1)), 0) * 100 from mst_trips mt, mst_deliveries md, wsh_locations wl1, wsh_locations wl2, fte_location_parameters flp1, fte_location_parameters flp2, fte_vehicle_types fvt, mtl_system_items_kfv msikfv, wsh_lookups wlk, wsh_carriers wc where mt.planned_flag <> 1 and md.pickup_location_id = mt.origin_location_id and mt.origin_location_id = wl1.wsh_location_id and wl1.wsh_location_id = flp1.location_id and md.dropoff_location_id = mt.destination_location_id and mt.destination_location_id = wl2.wsh_location_id and wl2.wsh_location_id = flp2.location_id and mt.carrier_id = wc.carrier_id and mt.vehicle_type_id = fvt.vehicle_type_id (+) and fvt.organization_id = msikfv.organization_id (+) and fvt.inventory_item_id = msikfv.inventory_item_id (+) and mt.service_level = wlk.lookup_code and wlk.lookup_type = 'WSH_SERVICE_LEVELS' and md.plan_id = mt.plan_id and mt.mode_of_transport IN ('LTL', 'PARCEL')
View Text - HTML Formatted

SELECT MT.PLAN_ID
, MT.TRIP_ID
, MT.CARRIER_ID
, MD.DELIVERY_ID
, MT.MODE_OF_TRANSPORT
, MT.ORIGIN_LOCATION_ID
, MT.DESTINATION_LOCATION_ID
, FLP1.FACILITY_ID
, FLP2.FACILITY_ID
, MT.TRIP_NUMBER
, SUBSTR(MST_WB_UTIL.GET_NAME(MT.ORIGIN_LOCATION_ID)
, 1
, 80)
, WL1.CITY
, WL1.STATE
, WL1.POSTAL_CODE
, WL1.COUNTRY
, SUBSTR(MST_WB_UTIL.GET_NAME(MT.DESTINATION_LOCATION_ID)
, 1
, 80)
, WL2.CITY
, WL2.STATE
, WL2.POSTAL_CODE
, WL2.COUNTRY
, WC.FREIGHT_CODE
, WLK.MEANING
, MSIKFV.CONCATENATED_SEGMENTS
, MT.PEAK_WEIGHT_UTILIZATION * 100
, MT.PEAK_VOLUME_UTILIZATION * 100
, MT.PEAK_PALLET_UTILIZATION * 100
, NVL((MST_AGG_PKG.GET_TOTAL_TRIP_VOLUME(MT.PLAN_ID
, MT.TRIP_ID) + NVL(MD.VOLUME
, 0))/DECODE(NVL(MT.EFFECTIVE_VOL_CAPACITY
, 1)
, 0
, 1
, NVL(MT.EFFECTIVE_VOL_CAPACITY
, 1))
, 0) * 100
FROM MST_TRIPS MT
, MST_DELIVERIES MD
, WSH_LOCATIONS WL1
, WSH_LOCATIONS WL2
, FTE_LOCATION_PARAMETERS FLP1
, FTE_LOCATION_PARAMETERS FLP2
, FTE_VEHICLE_TYPES FVT
, MTL_SYSTEM_ITEMS_KFV MSIKFV
, WSH_LOOKUPS WLK
, WSH_CARRIERS WC
WHERE MT.PLANNED_FLAG <> 1
AND MT.ORIGIN_LOCATION_ID = WL1.WSH_LOCATION_ID
AND WL1.WSH_LOCATION_ID = FLP1.LOCATION_ID
AND MT.DESTINATION_LOCATION_ID = WL2.WSH_LOCATION_ID
AND WL2.WSH_LOCATION_ID = FLP2.LOCATION_ID
AND MT.CARRIER_ID = WC.CARRIER_ID
AND MT.VEHICLE_TYPE_ID = FVT.VEHICLE_TYPE_ID (+)
AND FVT.ORGANIZATION_ID = MSIKFV.ORGANIZATION_ID (+)
AND FVT.INVENTORY_ITEM_ID = MSIKFV.INVENTORY_ITEM_ID (+)
AND MT.SERVICE_LEVEL = WLK.LOOKUP_CODE
AND WLK.LOOKUP_TYPE = 'WSH_SERVICE_LEVELS'
AND MD.PLAN_ID = MT.PLAN_ID
AND MT.MODE_OF_TRANSPORT = 'TRUCK' UNION ALL SELECT MT.PLAN_ID
, MT.TRIP_ID
, MT.CARRIER_ID
, MD.DELIVERY_ID
, MT.MODE_OF_TRANSPORT
, MT.ORIGIN_LOCATION_ID
, MT.DESTINATION_LOCATION_ID
, FLP1.FACILITY_ID
, FLP2.FACILITY_ID
, MT.TRIP_NUMBER
, SUBSTR(MST_WB_UTIL.GET_NAME(MT.ORIGIN_LOCATION_ID)
, 1
, 80)
, WL1.CITY
, WL1.STATE
, WL1.POSTAL_CODE
, WL1.COUNTRY
, SUBSTR(MST_WB_UTIL.GET_NAME(MT.DESTINATION_LOCATION_ID)
, 1
, 80)
, WL2.CITY
, WL2.STATE
, WL2.POSTAL_CODE
, WL2.COUNTRY
, WC.FREIGHT_CODE
, WLK.MEANING
, MSIKFV.CONCATENATED_SEGMENTS
, MT.PEAK_WEIGHT_UTILIZATION * 100
, MT.PEAK_VOLUME_UTILIZATION * 100
, MT.PEAK_PALLET_UTILIZATION * 100
, NVL((MST_AGG_PKG.GET_TOTAL_TRIP_VOLUME(MT.PLAN_ID
, MT.TRIP_ID) + NVL(MD.VOLUME
, 0))/DECODE(NVL(MT.EFFECTIVE_VOL_CAPACITY
, 1)
, 0
, 1
, NVL(MT.EFFECTIVE_VOL_CAPACITY
, 1))
, 0) * 100
FROM MST_TRIPS MT
, MST_DELIVERIES MD
, WSH_LOCATIONS WL1
, WSH_LOCATIONS WL2
, FTE_LOCATION_PARAMETERS FLP1
, FTE_LOCATION_PARAMETERS FLP2
, FTE_VEHICLE_TYPES FVT
, MTL_SYSTEM_ITEMS_KFV MSIKFV
, WSH_LOOKUPS WLK
, WSH_CARRIERS WC
WHERE MT.PLANNED_FLAG <> 1
AND MD.PICKUP_LOCATION_ID = MT.ORIGIN_LOCATION_ID
AND MT.ORIGIN_LOCATION_ID = WL1.WSH_LOCATION_ID
AND WL1.WSH_LOCATION_ID = FLP1.LOCATION_ID
AND MD.DROPOFF_LOCATION_ID = MT.DESTINATION_LOCATION_ID
AND MT.DESTINATION_LOCATION_ID = WL2.WSH_LOCATION_ID
AND WL2.WSH_LOCATION_ID = FLP2.LOCATION_ID
AND MT.CARRIER_ID = WC.CARRIER_ID
AND MT.VEHICLE_TYPE_ID = FVT.VEHICLE_TYPE_ID (+)
AND FVT.ORGANIZATION_ID = MSIKFV.ORGANIZATION_ID (+)
AND FVT.INVENTORY_ITEM_ID = MSIKFV.INVENTORY_ITEM_ID (+)
AND MT.SERVICE_LEVEL = WLK.LOOKUP_CODE
AND WLK.LOOKUP_TYPE = 'WSH_SERVICE_LEVELS'
AND MD.PLAN_ID = MT.PLAN_ID
AND MT.MODE_OF_TRANSPORT IN ('LTL'
, 'PARCEL')