DBA Data[Home] [Help]

VIEW: APPS.MST_UD_SUMMARY_V

Source

View Text - Preformatted

SELECT mp.plan_id , mp.compile_designator , mp.description , md.delivery_id , md.delivery_number , md.pickup_location_id , md.dropoff_location_id , substr(mst_wb_util.get_name(md.pickup_location_id),1,80) , flp1.facility_code , flp1.description , wl1.city , wl1.state , wl1.postal_code , wl1.country , substr(mst_wb_util.get_name(md.dropoff_location_id),1,80) , flp2.facility_code , flp2.description , wl2.city , wl2.state , wl2.postal_code , wl2.country , nvl(md.gross_weight,0) , mp.weight_uom , nvl(md.volume,0) , mp.volume_uom , nvl(md.number_of_pallets,0) , nvl(md.number_of_pieces,0) , ml.meaning , substr(mst_wb_util.get_local_chardt(md.pickup_location_id, md.earliest_pickup_date),1,40) , substr(mst_geocoding.get_timezone_code(md.pickup_location_id, md.earliest_pickup_date),1,20) , substr(mst_wb_util.get_local_chardt(md.pickup_location_id, md.latest_pickup_date),1,40) , substr(mst_geocoding.get_timezone_code(md.pickup_location_id, md.latest_pickup_date),1,20) , substr(mst_wb_util.get_local_chardt(md.dropoff_location_id, md.earliest_acceptable_date),1,40) , substr(mst_geocoding.get_timezone_code(md.dropoff_location_id, md.earliest_acceptable_date),1,20) , substr(mst_wb_util.get_local_chardt(md.dropoff_location_id, md.latest_acceptable_date),1,40) , substr(mst_geocoding.get_timezone_code(md.dropoff_location_id, md.latest_acceptable_date),1,20) from mst_plans mp , mst_deliveries md , wsh_locations wl1 , wsh_locations wl2 , fte_location_parameters flp1 , fte_location_parameters flp2 , mfg_lookups ml WHERE mp.plan_id = md.plan_id and md.pickup_location_id = wl1.wsh_location_id and md.dropoff_location_id = wl2.wsh_location_id and md.pickup_location_id = flp1.location_id and md.dropoff_location_id = flp2.location_id and ml.lookup_code = decode(md.planned_flag, 1, 1 , 2, decode(md.preserve_grouping_flag, 1, 2 , 2, 3 , 3 ) , 3 ) and ml.lookup_type = 'MST_DELIVERY_PLANNED_FLAG' and not exists (select null from mst_delivery_legs mdl where mdl.plan_id = md.plan_id and mdl.delivery_id = md.delivery_id)
View Text - HTML Formatted

SELECT MP.PLAN_ID
, MP.COMPILE_DESIGNATOR
, MP.DESCRIPTION
, MD.DELIVERY_ID
, MD.DELIVERY_NUMBER
, MD.PICKUP_LOCATION_ID
, MD.DROPOFF_LOCATION_ID
, SUBSTR(MST_WB_UTIL.GET_NAME(MD.PICKUP_LOCATION_ID)
, 1
, 80)
, FLP1.FACILITY_CODE
, FLP1.DESCRIPTION
, WL1.CITY
, WL1.STATE
, WL1.POSTAL_CODE
, WL1.COUNTRY
, SUBSTR(MST_WB_UTIL.GET_NAME(MD.DROPOFF_LOCATION_ID)
, 1
, 80)
, FLP2.FACILITY_CODE
, FLP2.DESCRIPTION
, WL2.CITY
, WL2.STATE
, WL2.POSTAL_CODE
, WL2.COUNTRY
, NVL(MD.GROSS_WEIGHT
, 0)
, MP.WEIGHT_UOM
, NVL(MD.VOLUME
, 0)
, MP.VOLUME_UOM
, NVL(MD.NUMBER_OF_PALLETS
, 0)
, NVL(MD.NUMBER_OF_PIECES
, 0)
, ML.MEANING
, SUBSTR(MST_WB_UTIL.GET_LOCAL_CHARDT(MD.PICKUP_LOCATION_ID
, MD.EARLIEST_PICKUP_DATE)
, 1
, 40)
, SUBSTR(MST_GEOCODING.GET_TIMEZONE_CODE(MD.PICKUP_LOCATION_ID
, MD.EARLIEST_PICKUP_DATE)
, 1
, 20)
, SUBSTR(MST_WB_UTIL.GET_LOCAL_CHARDT(MD.PICKUP_LOCATION_ID
, MD.LATEST_PICKUP_DATE)
, 1
, 40)
, SUBSTR(MST_GEOCODING.GET_TIMEZONE_CODE(MD.PICKUP_LOCATION_ID
, MD.LATEST_PICKUP_DATE)
, 1
, 20)
, SUBSTR(MST_WB_UTIL.GET_LOCAL_CHARDT(MD.DROPOFF_LOCATION_ID
, MD.EARLIEST_ACCEPTABLE_DATE)
, 1
, 40)
, SUBSTR(MST_GEOCODING.GET_TIMEZONE_CODE(MD.DROPOFF_LOCATION_ID
, MD.EARLIEST_ACCEPTABLE_DATE)
, 1
, 20)
, SUBSTR(MST_WB_UTIL.GET_LOCAL_CHARDT(MD.DROPOFF_LOCATION_ID
, MD.LATEST_ACCEPTABLE_DATE)
, 1
, 40)
, SUBSTR(MST_GEOCODING.GET_TIMEZONE_CODE(MD.DROPOFF_LOCATION_ID
, MD.LATEST_ACCEPTABLE_DATE)
, 1
, 20)
FROM MST_PLANS MP
, MST_DELIVERIES MD
, WSH_LOCATIONS WL1
, WSH_LOCATIONS WL2
, FTE_LOCATION_PARAMETERS FLP1
, FTE_LOCATION_PARAMETERS FLP2
, MFG_LOOKUPS ML
WHERE MP.PLAN_ID = MD.PLAN_ID
AND MD.PICKUP_LOCATION_ID = WL1.WSH_LOCATION_ID
AND MD.DROPOFF_LOCATION_ID = WL2.WSH_LOCATION_ID
AND MD.PICKUP_LOCATION_ID = FLP1.LOCATION_ID
AND MD.DROPOFF_LOCATION_ID = FLP2.LOCATION_ID
AND ML.LOOKUP_CODE = DECODE(MD.PLANNED_FLAG
, 1
, 1
, 2
, DECODE(MD.PRESERVE_GROUPING_FLAG
, 1
, 2
, 2
, 3
, 3 )
, 3 )
AND ML.LOOKUP_TYPE = 'MST_DELIVERY_PLANNED_FLAG'
AND NOT EXISTS (SELECT NULL
FROM MST_DELIVERY_LEGS MDL
WHERE MDL.PLAN_ID = MD.PLAN_ID
AND MDL.DELIVERY_ID = MD.DELIVERY_ID)