[Home] [Help]
28: lv_input_scenario_id IN NUMBER,
29: p_period_type IN NUMBER,
30: p_number_of_periods IN NUMBER ) AS
31:
32: lv_forecast_name MSD_DP_SCENARIO_REVISIONS.REVISION_NAME%TYPE;
33: lv_forecast_revision MSD_DP_SCENARIO_REVISIONS.REVISION%TYPE;
34:
35: -- This cursor is used to select the latest forecast version for the dynamic parameter of type input scenario.
36: CURSOR latest_forecast_version IS
29: p_period_type IN NUMBER,
30: p_number_of_periods IN NUMBER ) AS
31:
32: lv_forecast_name MSD_DP_SCENARIO_REVISIONS.REVISION_NAME%TYPE;
33: lv_forecast_revision MSD_DP_SCENARIO_REVISIONS.REVISION%TYPE;
34:
35: -- This cursor is used to select the latest forecast version for the dynamic parameter of type input scenario.
36: CURSOR latest_forecast_version IS
37: SELECT revision_name, revision
34:
35: -- This cursor is used to select the latest forecast version for the dynamic parameter of type input scenario.
36: CURSOR latest_forecast_version IS
37: SELECT revision_name, revision
38: FROM msd_dp_scenario_revisions
39: WHERE scenario_id = lv_input_scenario_id
40: AND demand_plan_id = lv_input_demand_plan_id
41: AND revision = (SELECT MAX (TO_NUMBER(revision))
42: FROM msd_dp_scenario_revisions
38: FROM msd_dp_scenario_revisions
39: WHERE scenario_id = lv_input_scenario_id
40: AND demand_plan_id = lv_input_demand_plan_id
41: AND revision = (SELECT MAX (TO_NUMBER(revision))
42: FROM msd_dp_scenario_revisions
43: WHERE scenario_id = lv_input_scenario_id
44: AND demand_plan_id = lv_input_demand_plan_id)
45: FOR UPDATE;
46: