DBA Data[Home] [Help]

VIEW: APPS.MST_ACT_BEFORE_AFTER_TL_V

Source

View Text - Preformatted

SELECT mt.plan_id, mir.number1, mt.trip_id, to_number(null), mir.in_request_id, mt.trip_number, wlk.meaning, MST_AGG_PKG.GET_TOTAL_TRIP_WEIGHT(mt.plan_id, mt.trip_id), mp.weight_uom, MST_AGG_PKG.GET_TOTAL_TRIP_VOLUME(mt.plan_id, mt.trip_id), mp.volume_uom, MST_AGG_PKG.GET_TOTAL_TRIP_PALLETS(mt.plan_id, mt.trip_id), MST_AGG_PKG.GET_TOTAL_TRIP_PIECES(mt.plan_id, mt.trip_id), mt.total_trip_distance, mp.distance_uom, MST_AGG_PKG.GET_NUM_OF_STOPS_FOR_TL(mt.plan_id, mt.trip_id), MST_WB_UTIL.GET_TRIP_CIRCUITY(mt.plan_id, mt.trip_id), nvl(mt.total_basic_transport_cost,0) + nvl(mt.total_stop_cost, 0) + nvl(mt.total_load_unload_cost,0) + nvl(mt.total_layover_cost, 0) + nvl(mt.total_accessorial_cost, 0) + nvl(mt.total_handling_cost, 0), 'TRIP', 1 from mst_plans mp, mst_trips mt, wsh_lookups wlk, mst_in_requests mir WHERE mp.plan_id = mt.plan_id and mt.mode_of_transport = wlk.lookup_code and wlk.lookup_type = 'WSH_MODE_OF_TRANSPORT' and mt.plan_id = mir.plan_id and mt.trip_id = mir.trip_id and mir.type_id = 15 union all select md.plan_id, mir.trip_id, to_number(null), md.delivery_id, mir.in_request_id, md.delivery_number, substr(MST_WB_UTIL.get_meaning('MST_STRING', 36, 'MFG'), 1, 80), md.gross_weight, mp.weight_uom, md.volume, mp.volume_uom, md.number_of_pallets, md.number_of_pieces, to_number(null), null, to_number(null), to_number(null), to_number(null), 'DELIVERY', 1 from mst_plans mp, mst_deliveries md, mst_in_requests mir where mp.plan_id = md.plan_id and md.plan_id = mir.plan_id and md.delivery_id = mir.delivery_id and mir.type_id = 12 union all select mt.plan_id, mt.trip_id, to_number(null), to_number(null), mir.in_request_id, mt.trip_number, wlk.meaning, MST_AGG_PKG.GET_TOTAL_TRIP_WEIGHT(mt.plan_id, mt.trip_id), mp.weight_uom, MST_AGG_PKG.GET_TOTAL_TRIP_VOLUME(mt.plan_id, mt.trip_id), mp.volume_uom, MST_AGG_PKG.GET_TOTAL_TRIP_PALLETS(mt.plan_id, mt.trip_id), MST_AGG_PKG.GET_TOTAL_TRIP_PIECES(mt.plan_id, mt.trip_id), mt.total_trip_distance, mp.distance_uom, MST_AGG_PKG.GET_NUM_OF_STOPS_FOR_TL(mt.plan_id, mt.trip_id), MST_WB_UTIL.GET_TRIP_CIRCUITY(mt.plan_id, mt.trip_id), nvl(mt.total_basic_transport_cost,0) + nvl(mt.total_stop_cost, 0) + nvl(mt.total_load_unload_cost,0) + nvl(mt.total_layover_cost, 0) + nvl(mt.total_accessorial_cost, 0) + nvl(mt.total_handling_cost, 0), 'TRIP', 2 from mst_plans mp, mst_trips mt, wsh_lookups wlk, mst_in_requests mir where mp.plan_id = mt.plan_id and mt.mode_of_transport = wlk.lookup_code and wlk.lookup_type = 'WSH_MODE_OF_TRANSPORT' and mt.plan_id = mir.plan_id and mt.trip_id = mir.number1 union all select to_number(null), to_number(null), to_number(null), to_number(null), in_request_id, to_number(null), null, to_number(null), null, to_number(null), null, to_number(null), to_number(null), to_number(null), null, to_number(null), to_number(null), to_number(null), null, 3 from mst_in_requests union all select mt.plan_id, mt.trip_id, to_number(null), to_number(null), mor.in_request_id, mt.trip_number, wlk.meaning, mor.number4, weight_uom, mor.number5, mp.volume_uom, mor.number6, mor.number7, mor.number8, distance_uom, mor.number9, mor.number10, mor.number2, 'TRIP', 4 from mst_plans mp, mst_trips mt, mst_out_requests mor, mst_in_requests mir, wsh_lookups wlk where mp.plan_id = mt.plan_id and mt.plan_id = mir.plan_id and mt.trip_id = mir.number1 and mir.in_request_id = mor.in_request_id and mt.mode_of_transport = wlk.lookup_code and wlk.lookup_type = 'WSH_MODE_OF_TRANSPORT'
View Text - HTML Formatted

SELECT MT.PLAN_ID
, MIR.NUMBER1
, MT.TRIP_ID
, TO_NUMBER(NULL)
, MIR.IN_REQUEST_ID
, MT.TRIP_NUMBER
, WLK.MEANING
, MST_AGG_PKG.GET_TOTAL_TRIP_WEIGHT(MT.PLAN_ID
, MT.TRIP_ID)
, MP.WEIGHT_UOM
, MST_AGG_PKG.GET_TOTAL_TRIP_VOLUME(MT.PLAN_ID
, MT.TRIP_ID)
, MP.VOLUME_UOM
, MST_AGG_PKG.GET_TOTAL_TRIP_PALLETS(MT.PLAN_ID
, MT.TRIP_ID)
, MST_AGG_PKG.GET_TOTAL_TRIP_PIECES(MT.PLAN_ID
, MT.TRIP_ID)
, MT.TOTAL_TRIP_DISTANCE
, MP.DISTANCE_UOM
, MST_AGG_PKG.GET_NUM_OF_STOPS_FOR_TL(MT.PLAN_ID
, MT.TRIP_ID)
, MST_WB_UTIL.GET_TRIP_CIRCUITY(MT.PLAN_ID
, MT.TRIP_ID)
, NVL(MT.TOTAL_BASIC_TRANSPORT_COST
, 0) + NVL(MT.TOTAL_STOP_COST
, 0) + NVL(MT.TOTAL_LOAD_UNLOAD_COST
, 0) + NVL(MT.TOTAL_LAYOVER_COST
, 0) + NVL(MT.TOTAL_ACCESSORIAL_COST
, 0) + NVL(MT.TOTAL_HANDLING_COST
, 0)
, 'TRIP'
, 1
FROM MST_PLANS MP
, MST_TRIPS MT
, WSH_LOOKUPS WLK
, MST_IN_REQUESTS MIR
WHERE MP.PLAN_ID = MT.PLAN_ID
AND MT.MODE_OF_TRANSPORT = WLK.LOOKUP_CODE
AND WLK.LOOKUP_TYPE = 'WSH_MODE_OF_TRANSPORT'
AND MT.PLAN_ID = MIR.PLAN_ID
AND MT.TRIP_ID = MIR.TRIP_ID
AND MIR.TYPE_ID = 15 UNION ALL SELECT MD.PLAN_ID
, MIR.TRIP_ID
, TO_NUMBER(NULL)
, MD.DELIVERY_ID
, MIR.IN_REQUEST_ID
, MD.DELIVERY_NUMBER
, SUBSTR(MST_WB_UTIL.GET_MEANING('MST_STRING'
, 36
, 'MFG')
, 1
, 80)
, MD.GROSS_WEIGHT
, MP.WEIGHT_UOM
, MD.VOLUME
, MP.VOLUME_UOM
, MD.NUMBER_OF_PALLETS
, MD.NUMBER_OF_PIECES
, TO_NUMBER(NULL)
, NULL
, TO_NUMBER(NULL)
, TO_NUMBER(NULL)
, TO_NUMBER(NULL)
, 'DELIVERY'
, 1
FROM MST_PLANS MP
, MST_DELIVERIES MD
, MST_IN_REQUESTS MIR
WHERE MP.PLAN_ID = MD.PLAN_ID
AND MD.PLAN_ID = MIR.PLAN_ID
AND MD.DELIVERY_ID = MIR.DELIVERY_ID
AND MIR.TYPE_ID = 12 UNION ALL SELECT MT.PLAN_ID
, MT.TRIP_ID
, TO_NUMBER(NULL)
, TO_NUMBER(NULL)
, MIR.IN_REQUEST_ID
, MT.TRIP_NUMBER
, WLK.MEANING
, MST_AGG_PKG.GET_TOTAL_TRIP_WEIGHT(MT.PLAN_ID
, MT.TRIP_ID)
, MP.WEIGHT_UOM
, MST_AGG_PKG.GET_TOTAL_TRIP_VOLUME(MT.PLAN_ID
, MT.TRIP_ID)
, MP.VOLUME_UOM
, MST_AGG_PKG.GET_TOTAL_TRIP_PALLETS(MT.PLAN_ID
, MT.TRIP_ID)
, MST_AGG_PKG.GET_TOTAL_TRIP_PIECES(MT.PLAN_ID
, MT.TRIP_ID)
, MT.TOTAL_TRIP_DISTANCE
, MP.DISTANCE_UOM
, MST_AGG_PKG.GET_NUM_OF_STOPS_FOR_TL(MT.PLAN_ID
, MT.TRIP_ID)
, MST_WB_UTIL.GET_TRIP_CIRCUITY(MT.PLAN_ID
, MT.TRIP_ID)
, NVL(MT.TOTAL_BASIC_TRANSPORT_COST
, 0) + NVL(MT.TOTAL_STOP_COST
, 0) + NVL(MT.TOTAL_LOAD_UNLOAD_COST
, 0) + NVL(MT.TOTAL_LAYOVER_COST
, 0) + NVL(MT.TOTAL_ACCESSORIAL_COST
, 0) + NVL(MT.TOTAL_HANDLING_COST
, 0)
, 'TRIP'
, 2
FROM MST_PLANS MP
, MST_TRIPS MT
, WSH_LOOKUPS WLK
, MST_IN_REQUESTS MIR
WHERE MP.PLAN_ID = MT.PLAN_ID
AND MT.MODE_OF_TRANSPORT = WLK.LOOKUP_CODE
AND WLK.LOOKUP_TYPE = 'WSH_MODE_OF_TRANSPORT'
AND MT.PLAN_ID = MIR.PLAN_ID
AND MT.TRIP_ID = MIR.NUMBER1 UNION ALL SELECT TO_NUMBER(NULL)
, TO_NUMBER(NULL)
, TO_NUMBER(NULL)
, TO_NUMBER(NULL)
, IN_REQUEST_ID
, TO_NUMBER(NULL)
, NULL
, TO_NUMBER(NULL)
, NULL
, TO_NUMBER(NULL)
, NULL
, TO_NUMBER(NULL)
, TO_NUMBER(NULL)
, TO_NUMBER(NULL)
, NULL
, TO_NUMBER(NULL)
, TO_NUMBER(NULL)
, TO_NUMBER(NULL)
, NULL
, 3
FROM MST_IN_REQUESTS UNION ALL SELECT MT.PLAN_ID
, MT.TRIP_ID
, TO_NUMBER(NULL)
, TO_NUMBER(NULL)
, MOR.IN_REQUEST_ID
, MT.TRIP_NUMBER
, WLK.MEANING
, MOR.NUMBER4
, WEIGHT_UOM
, MOR.NUMBER5
, MP.VOLUME_UOM
, MOR.NUMBER6
, MOR.NUMBER7
, MOR.NUMBER8
, DISTANCE_UOM
, MOR.NUMBER9
, MOR.NUMBER10
, MOR.NUMBER2
, 'TRIP'
, 4
FROM MST_PLANS MP
, MST_TRIPS MT
, MST_OUT_REQUESTS MOR
, MST_IN_REQUESTS MIR
, WSH_LOOKUPS WLK
WHERE MP.PLAN_ID = MT.PLAN_ID
AND MT.PLAN_ID = MIR.PLAN_ID
AND MT.TRIP_ID = MIR.NUMBER1
AND MIR.IN_REQUEST_ID = MOR.IN_REQUEST_ID
AND MT.MODE_OF_TRANSPORT = WLK.LOOKUP_CODE
AND WLK.LOOKUP_TYPE = 'WSH_MODE_OF_TRANSPORT'