-- This is the View DEMAND_RESULTS_V CREATE OR REPLACE FORCE VIEW Demand_Results_v(st_Week,st_Start_dt,st_End_dt,BookIng_Forecast_Group_Key,st_Origin_Group,st_Origin,st_Destination_Group,st_Destination,st_Contr_Group,Rate,st_InIt_Rate,st_Revenue,st_Route_Exists_Flag,Daily_Final_Demand_Key,st_InIt_cntrs,st_acc_num_cntr,st_Reject_num_cntr,st_InIt_Demand_Weight,st_acc_Weight,st_Reject_wt,st_InIt_Demand_Volume,st_acc_Volume,st_Reject_vol) AS SELECT dfd.Week, dfd.Demand_dt - 3, dfd.Demand_dt + 3, bfg.BookIng_Forecast_Group_Key, Orgn.Geographic_Group, bfg.Origin, dstn.Geographic_Group, bfg.Destination, bfg.Container_Group_Code, dfd.Rate, dfd.Rate, dfdr.Activity * dfd.Rate AS Revenue, dfd.Route_Exists_Flag, dfd.Daily_Final_Demand_Key, num_ctrs AS InIt_cntrs, DECODE(bfg.Container_Group_Code,'BLK',0, dfdr.Activity) AS acc_num_cntr, DECODE(bfg.Container_Group_Code,'BLK',0, dfdr.Slack) AS Reject_num_cntr, dfd.Weight AS InIt_Demand_Weight, DECODE(bfg.Container_Group_Code,'BLK',dfdr.Activity, (dfd.Weight / DECODE(dfd.num_ctrs,0,1, dfd.num_ctrs)) * dfdr.Activity) AS acc_Weight, TRIM(To_char(DECODE(bfg.Container_Group_Code,'BLK',dfdr.Slack, (dfd.Weight / DECODE(dfd.num_ctrs,0,1, dfd.num_ctrs)) * dfdr.Slack), '999999999.99')) AS Reject_wt, dfd.Volume AS InIt_Demand_Volume, TRIM(To_char(DECODE(bfg.Container_Group_Code,'BLK',(dfdr.Activity / DECODE((dfd.Weight / DECODE(dfd.Volume,0,1, dfd.Volume)), 0,1, (dfd.Weight / DECODE(dfd.Volume,0,1, dfd.Volume)))), (dfd.Volume / DECODE(dfd.num_ctrs,0,1, dfd.num_ctrs)) * dfdr.Activity), '999999999.99')) AS acc_Volume, TRIM(To_char(DECODE(bfg.Container_Group_Code,'BLK',(dfdr.Slack / DECODE((dfd.Weight / DECODE(dfd.Volume,0,1, dfd.Volume)), 0,1, (dfd.Weight / DECODE(dfd.Volume,0,1, dfd.Volume)))), (dfd.Volume / DECODE(dfd.num_ctrs,0,1, dfd.num_ctrs)) * dfdr.Slack), '999999999.99')) AS Reject_vol FROM BookIng_Forecast_Group bfg, Daily_Final_Demand dfd, Daily_Final_Demand_Results dfdr, stLocation_Node_Map_lkp_ui_v Orgn, stLocation_Node_Map_lkp_ui_v dstn, Scenario s WHERE bfg.BookIng_Forecast_Group_Key = dfd.BookIng_Forecast_Group_Key AND dfd.Daily_Final_Demand_Key = dfdr.Daily_Final_Demand_Key (+) AND dfd.Scenario_Key = dfdr.Scenario_Key AND dfd.Scenario_Key = s.Scenario_Key AND s.Scenario_Key = Get_Last_Scenario AND bfg.Origin = Orgn.Airport_Code AND bfg.Destination = dstn.Airport_Code AND bfg.commod_Code <> (SELECT mtCommodity_Group_Code FROM mtCommodity_Group WHERE ctr_commod_Code = '9999'); select * from v$version; Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi PL/SQL Release 10.2.0.3.0 - Production CORE 10.2.0.3.0 Production TNS for Linux: Version 10.2.0.3.0 - Production NLSRTL Version 10.2.0.3.0 - Production SELECT st_week, GROUPING (st_week) AS g_st_week, st_start_dt, GROUPING (st_start_dt) AS g_st_start_dt, st_end_dt, GROUPING (st_end_dt) AS g_st_end_dt, st_origin_group, GROUPING (st_origin_group) AS g_st_origin_group, st_origin, GROUPING (st_origin) AS g_st_origin, st_destination_group, GROUPING (st_destination_group) AS g_st_destination_group, st_destination, GROUPING (st_destination) AS g_st_destination, st_contr_group, GROUPING (st_contr_group) AS g_st_contr_group, st_init_rate, GROUPING (st_init_rate) AS g_st_init_rate, rate, GROUPING (rate) AS g_rate, st_revenue, GROUPING (st_revenue) AS g_st_revenue, st_route_exists_flag, GROUPING (st_route_exists_flag) AS g_st_route_exists_flag, SUM (st_init_cntrs) AS st_init_cntrs, SUM (st_acc_num_cntr) AS st_acc_num_cntr, SUM (st_reject_num_cntr) AS st_reject_num_cntr, SUM (st_init_demand_weight) AS st_init_demand_weight, SUM (st_acc_weight) AS st_acc_weight, SUM (st_reject_wt) AS st_reject_wt, SUM (st_init_demand_volume) AS st_init_demand_volume, SUM (st_acc_volume) AS st_acc_volume, SUM (st_reject_vol) AS st_reject_vol FROM [B]demand_results_v[/B] GROUP BY ROLLUP (st_week, st_start_dt, st_end_dt, st_origin_group, st_origin, st_destination_group, st_destination, st_contr_group, st_init_rate, rate, st_revenue, st_route_exists_flag) HAVING ( ( GROUPING (st_week) + GROUPING (st_start_dt) + GROUPING (st_end_dt) + GROUPING (st_origin_group) + GROUPING (st_origin) + GROUPING (st_destination_group) + GROUPING (st_destination) + GROUPING (st_contr_group) + GROUPING (st_init_rate) + GROUPING (rate) + GROUPING (st_revenue) + GROUPING (st_route_exists_flag) = 0 ) OR ( GROUPING (st_week) = 1 AND GROUPING (st_start_dt) = 1 AND GROUPING (st_end_dt) = 1 AND GROUPING (st_origin_group) = 1 AND GROUPING (st_origin) = 1 AND GROUPING (st_destination_group) = 1 AND GROUPING (st_destination) = 1 AND GROUPING (st_contr_group) = 1 AND GROUPING (st_init_rate) = 1 AND GROUPING (rate) = 1 AND GROUPING (st_revenue) = 1 AND GROUPING (st_route_exists_flag) = 1 ) ) ORDER BY st_week ASC, st_start_dt ASC, st_end_dt ASC, st_origin_group ASC, st_origin ASC, st_destination_group ASC, st_destination ASC, st_contr_group ASC, st_init_rate ASC, rate ASC, st_revenue ASC, st_route_exists_flag ASC / ORA-03001 UNIMPLEMENTED FEATURE