[Home] [Help]
1011:
1012: TYPE t_cursor IS REF CURSOR;
1013: h_cursor t_cursor;
1014:
1015: -- Fix perf bug#4924515 use bsc_sys_periodicities instead of bsc_sys_periodicities_vl
1016: CURSOR c_tables (p_table_type NUMBER, p_calendar_id NUMBER) IS
1017: SELECT t.table_name, t.periodicity_id, t.current_period, p.yearly_flag
1018: FROM bsc_db_tables t, bsc_sys_periodicities p
1019: WHERE t.periodicity_id = p.periodicity_id AND
1037: /*
1038: CURSOR c_sum_tables_mv (p_table_type1 NUMBER, p_gen_type NUMBER,
1039: p_calendar_id NUMBER, p_table_type0 NUMBER) IS
1040: SELECT t.table_name, t.periodicity_id, t.current_period, p.yearly_flag
1041: FROM bsc_db_tables t, bsc_sys_periodicities_vl p
1042: WHERE t.periodicity_id = p.periodicity_id AND
1043: t.table_type = p_table_type1 AND t.generation_type <> p_gen_type AND
1044: p.calendar_id = p_calendar_id AND
1045: NOT (t.table_name IN (
1047: FROM bsc_db_tables_rels r, bsc_db_tables b
1048: WHERE r.source_table_name = b.table_name and b.table_type = p_table_type0
1049: ));
1050: */
1051: --Fix perf bug#4924515 use bsc_sys_periodicities instead of bsc_sys_periodicities_vl
1052: CURSOR c_sum_tables_mv (p_calendar_id NUMBER) IS
1053: SELECT DISTINCT k.projection_data
1054: FROM bsc_kpi_data_tables k, bsc_sys_periodicities p
1055: WHERE k.periodicity_id = p.periodicity_id AND
1066: TYPE t_tables IS RECORD (
1067: table_name bsc_db_tables.table_name%TYPE,
1068: periodicity_id bsc_db_tables.periodicity_id%TYPE,
1069: current_period bsc_db_tables.current_period%TYPE,
1070: yearly_flag bsc_sys_periodicities_vl.yearly_flag%TYPE
1071: );
1072:
1073: h_table_info t_tables;
1074:
1419: CLOSE c_tables;
1420: END IF;
1421:
1422: -- Update the current period of data tables
1423: -- Fix perf bug#4924515 use bsc_sys_periodiicties instead of bsc_sys_periodicities_vl
1424: UPDATE
1425: bsc_db_tables
1426: SET
1427: current_period = h_current_fy + 1,
6136: /*
6137: c_tables t_cursor; -- g_process_id
6138: c_tables_sql VARCHAR2(2000) := 'SELECT lc.input_table_name, t.periodicity_id,'||
6139: ' p.name, t.current_period, t.current_subperiod'||
6140: ' FROM bsc_db_tables t, bsc_db_loader_control lc, bsc_sys_periodicities_vl p'||
6141: ' WHERE lc.input_table_name = t.table_name AND'||
6142: ' lc.process_id = :1 AND t.periodicity_id = p.periodicity_id';
6143: */
6144: CURSOR c_tables (p_process_id NUMBER) IS
6143: */
6144: CURSOR c_tables (p_process_id NUMBER) IS
6145: SELECT lc.input_table_name, t.periodicity_id,
6146: p.name, t.current_period, t.current_subperiod
6147: FROM bsc_db_tables t, bsc_db_loader_control lc, bsc_sys_periodicities_vl p
6148: WHERE lc.input_table_name = t.table_name AND
6149: lc.process_id = p_process_id AND t.periodicity_id = p.periodicity_id;
6150:
6151: h_periodicity_id NUMBER;