DBA Data[Home] [Help]

APPS.MSD_VALIDATE_DEMAND_PLAN dependencies on MSD_TIME

Line 247: FROM msd_time dp

243: --
244: CURSOR get_tim(p_calendar_type VARCHAR2, p_calendar_code VARCHAR2,
245: p_start_date DATE, p_end_date DATE) IS
246: SELECT MIN(day) min_date, MAX(day) max_date
247: FROM msd_time dp
248: WHERE dp.calendar_type = p_calendar_type
249: AND dp.calendar_code = p_calendar_code
250: AND day between p_start_date and p_end_date;
251:

Line 770: FROM msd_time mtv, msd_dp_calendars mdc

766: p_demand_plan_id IN NUMBER,
767: p_field_name IN VARCHAR2) IS
768: CURSOR C1 IS
769: SELECT count(1)
770: FROM msd_time mtv, msd_dp_calendars mdc
771: WHERE mtv.day = p_date
772: AND rownum = 1
773: AND mtv.calendar_type = mdc.calendar_type
774: AND mtv.calendar_code = mdc.calendar_code

Line 2132: /* Translate Time Level Id into Time Column in MSD_TIME */

2128: from msd_cs_defn_dim_dtls
2129: where cs_definition_id = p_cs_definition_id
2130: and dimension_code = p_dim_code;
2131:
2132: /* Translate Time Level Id into Time Column in MSD_TIME */
2133: cursor tim_lvl_id_2_clmn (p_lvl_id in number) is
2134: select decode(p_lvl_id,
2135: '1', 'WEEK_END_DATE ',
2136: '2', 'MONTH_END_DATE ',

Line 2367: /* BUG 2419958 : Add clause to check that data exists in msd_time_v too.

2363: l_new_stmt := l_new_stmt || ' AND src.action_code <> ''D''';
2364: end if;
2365: End IF;
2366:
2367: /* BUG 2419958 : Add clause to check that data exists in msd_time_v too.
2368: * Retrieve the end_date and level_id to find out a row in time and fact that match.
2369: */
2370: l_stmt := l_stmt || ' AND EXISTS (select 1 from msd_time tim where src.';
2371: l_stmt := l_stmt || l_date_col || ' = tim.' || nvl(time_level_column, 'DAY');

Line 2370: l_stmt := l_stmt || ' AND EXISTS (select 1 from msd_time tim where src.';

2366:
2367: /* BUG 2419958 : Add clause to check that data exists in msd_time_v too.
2368: * Retrieve the end_date and level_id to find out a row in time and fact that match.
2369: */
2370: l_stmt := l_stmt || ' AND EXISTS (select 1 from msd_time tim where src.';
2371: l_stmt := l_stmt || l_date_col || ' = tim.' || nvl(time_level_column, 'DAY');
2372:
2373: l_stmt := l_stmt || ' and (tim.calendar_type, tim.calendar_code) in (select mdc.calendar_type, mdc.calendar_code from msd_dp_calendars mdc where mdc.demand_plan_id = ' || p_demand_plan_id || ')';
2374: l_stmt := l_stmt || ' and ' || time_cal_type || ' = tim.calendar_type)';

Line 2378: l_new_stmt := l_new_stmt || ' AND EXISTS (select 1 from msd_time tim where src.';

2374: l_stmt := l_stmt || ' and ' || time_cal_type || ' = tim.calendar_type)';
2375:
2376:
2377: If c_input_rec.ascp_stream_flag = 'Y' then
2378: l_new_stmt := l_new_stmt || ' AND EXISTS (select 1 from msd_time tim where src.';
2379: l_new_stmt := l_new_stmt || l_date_col || ' = tim.' || nvl(time_level_column, 'DAY');
2380:
2381: l_new_stmt := l_new_stmt || ' and (tim.calendar_type, tim.calendar_code) in (select mdc.calendar_type, mdc.calendar_code from msd_dp_calendars mdc where mdc.demand_plan_id = ' || p_demand_plan_id || ')';
2382: l_new_stmt := l_new_stmt || ' and ' || time_cal_type || ' = tim.calendar_type)';

Line 2793: l_stmt := l_stmt || ' from msd_time ';

2789: fetch c2 into p_date_clmn;
2790: close c2;
2791:
2792: l_stmt := 'SELECT ' || p_date_clmn;
2793: l_stmt := l_stmt || ' from msd_time ';
2794: l_stmt := l_stmt || ' where calendar_type = ' || p_calendar_type;
2795: l_stmt := l_stmt || ' and calendar_code in ';
2796: l_stmt := l_stmt || '(SELECT calendar_code FROM msd_dp_calendars';
2797: l_stmt := l_stmt || ' WHERE demand_plan_id = ' || p_demand_plan_id;