DBA Data[Home] [Help]

VIEW: APPS.MSD_DP_SCE_SCENARIOS_V

Source

View Text - Preformatted

SELECT ds.demand_plan_id, dp.demand_plan_name, ds.scenario_id, ds.scenario_name, dp.organization_id, dp.sr_instance_id FROM msd_dp_scenarios ds, msd_demand_plans dp WHERE ds.demand_plan_id = dp.demand_plan_id and ds.last_revision is not null and /* item level */ exists(select 1 from msd_dp_scenario_output_levels ol where ol.demand_plan_id = ds.demand_plan_id and ol.scenario_id = ds.scenario_id and ol.level_id = 1) and /* organization level */ exists(select 1 from msd_dp_scenario_output_levels ol where ol.demand_plan_id = ds.demand_plan_id and ol.scenario_id = ds.scenario_id and ol.level_id = 7) and /* geography level */ exists(select 1 from msd_dp_scenario_output_levels ol where ol.demand_plan_id = ds.demand_plan_id and ol.scenario_id = ds.scenario_id and ol.level_id = 11)
View Text - HTML Formatted

SELECT DS.DEMAND_PLAN_ID
, DP.DEMAND_PLAN_NAME
, DS.SCENARIO_ID
, DS.SCENARIO_NAME
, DP.ORGANIZATION_ID
, DP.SR_INSTANCE_ID
FROM MSD_DP_SCENARIOS DS
, MSD_DEMAND_PLANS DP
WHERE DS.DEMAND_PLAN_ID = DP.DEMAND_PLAN_ID
AND DS.LAST_REVISION IS NOT NULL
AND /* ITEM LEVEL */ EXISTS(SELECT 1
FROM MSD_DP_SCENARIO_OUTPUT_LEVELS OL
WHERE OL.DEMAND_PLAN_ID = DS.DEMAND_PLAN_ID
AND OL.SCENARIO_ID = DS.SCENARIO_ID
AND OL.LEVEL_ID = 1)
AND /* ORGANIZATION LEVEL */ EXISTS(SELECT 1
FROM MSD_DP_SCENARIO_OUTPUT_LEVELS OL
WHERE OL.DEMAND_PLAN_ID = DS.DEMAND_PLAN_ID
AND OL.SCENARIO_ID = DS.SCENARIO_ID
AND OL.LEVEL_ID = 7)
AND /* GEOGRAPHY LEVEL */ EXISTS(SELECT 1
FROM MSD_DP_SCENARIO_OUTPUT_LEVELS OL
WHERE OL.DEMAND_PLAN_ID = DS.DEMAND_PLAN_ID
AND OL.SCENARIO_ID = DS.SCENARIO_ID
AND OL.LEVEL_ID = 11)