DBA Data[Home] [Help]

APPS.BSC_UPDATE_UTIL dependencies on BSC_SYS_PERIODICITIES

Line 19: FROM BSC_SYS_PERIODICITIES

15: TYPE t_cursor IS REF CURSOR;
16:
17: CURSOR c_base_per (p_calendar_id NUMBER, p_custom_code NUMBER) IS
18: SELECT PERIODICITY_ID
19: FROM BSC_SYS_PERIODICITIES
20: WHERE CALENDAR_ID = p_calendar_id AND CUSTOM_CODE < p_custom_code
21: ORDER BY PERIODICITY_ID;
22:
23: CURSOR c_new_per (p_calendar_id NUMBER) IS

Line 25: FROM BSC_SYS_PERIODICITIES

21: ORDER BY PERIODICITY_ID;
22:
23: CURSOR c_new_per (p_calendar_id NUMBER) IS
24: SELECT PERIODICITY_ID,SOURCE
25: FROM BSC_SYS_PERIODICITIES
26: WHERE CALENDAR_ID = p_calendar_id
27: ORDER BY PERIODICITY_ID;
28:
29: h_periodicity_type NUMBER;

Line 33: FROM BSC_SYS_PERIODICITIES

29: h_periodicity_type NUMBER;
30:
31: CURSOR c_get_per (p_calendar_id NUMBER, p_periodicity_type NUMBER) IS
32: SELECT PERIODICITY_ID
33: FROM BSC_SYS_PERIODICITIES
34: WHERE CALENDAR_ID = p_calendar_id AND PERIODICITY_TYPE = p_periodicity_type;
35:
36: h_periodicity_id NUMBER;
37: h_source VARCHAR2(200);

Line 59: ' INSERT INTO BSC_SYS_PERIODICITIES ' ||

55: WHILE c_base_per%FOUND LOOP
56: --Copy the periodicity with a new PERIODICITY_ID and CALENDAR_ID
57: /*
58: sql_stmt :=
59: ' INSERT INTO BSC_SYS_PERIODICITIES ' ||
60: ' (PERIODICITY_ID,NUM_OF_PERIODS,SOURCE,NUM_OF_SUBPERIODS,PERIOD_COL_NAME, ' ||
61: ' SUBPERIOD_COL_NAME,YEARLY_FLAG,EDW_FLAG,CALENDAR_ID,EDW_PERIODICITY_ID, ' ||
62: ' CUSTOM_CODE,DB_COLUMN_NAME,PERIODICITY_TYPE) ' ||
63: ' SELECT BSC_SYS_PERIODICITY_ID_S.NEXTVAL PERIODICITY_ID,NUM_OF_PERIODS,SOURCE,NUM_OF_SUBPERIODS, '||

Line 66: ' FROM BSC_SYS_PERIODICITIES ' ||

62: ' CUSTOM_CODE,DB_COLUMN_NAME,PERIODICITY_TYPE) ' ||
63: ' SELECT BSC_SYS_PERIODICITY_ID_S.NEXTVAL PERIODICITY_ID,NUM_OF_PERIODS,SOURCE,NUM_OF_SUBPERIODS, '||
64: ' PERIOD_COL_NAME,SUBPERIOD_COL_NAME,YEARLY_FLAG,EDW_FLAG, '||
65: ' :1 CALENDAR_ID,EDW_PERIODICITY_ID,CUSTOM_CODE,DB_COLUMN_NAME,PERIODICITY_TYPE '||
66: ' FROM BSC_SYS_PERIODICITIES ' ||
67: ' WHERE PERIODICITY_ID = :2';
68:
69: h_bind_vars_values.delete;
70: h_bind_vars_values(1) := x_calendar_id;

Line 75: INSERT INTO BSC_SYS_PERIODICITIES (

71: h_bind_vars_values(2) := h_periodicity_id;
72: h_num_bind_vars := 2;
73: BSC_UPDATE_UTIL.Execute_Immediate(sql_stmt, h_bind_vars_values, h_num_bind_vars);
74: */
75: INSERT INTO BSC_SYS_PERIODICITIES (
76: PERIODICITY_ID,NUM_OF_PERIODS,SOURCE,NUM_OF_SUBPERIODS,PERIOD_COL_NAME,
77: SUBPERIOD_COL_NAME,YEARLY_FLAG,EDW_FLAG,CALENDAR_ID,EDW_PERIODICITY_ID,
78: CUSTOM_CODE,DB_COLUMN_NAME,PERIODICITY_TYPE)
79: SELECT BSC_SYS_PERIODICITY_ID_S.NEXTVAL PERIODICITY_ID,NUM_OF_PERIODS,SOURCE,NUM_OF_SUBPERIODS,

Line 82: FROM BSC_SYS_PERIODICITIES

78: CUSTOM_CODE,DB_COLUMN_NAME,PERIODICITY_TYPE)
79: SELECT BSC_SYS_PERIODICITY_ID_S.NEXTVAL PERIODICITY_ID,NUM_OF_PERIODS,SOURCE,NUM_OF_SUBPERIODS,
80: PERIOD_COL_NAME,SUBPERIOD_COL_NAME,YEARLY_FLAG,EDW_FLAG,
81: x_calendar_id CALENDAR_ID,EDW_PERIODICITY_ID,CUSTOM_CODE,DB_COLUMN_NAME,PERIODICITY_TYPE
82: FROM BSC_SYS_PERIODICITIES
83: WHERE PERIODICITY_ID = h_periodicity_id;
84:
85: FETCH c_base_per INTO h_periodicity_id;
86: END LOOP;

Line 114: sql_stmt := 'UPDATE BSC_SYS_PERIODICITIES SET SOURCE = :1 WHERE PERIODICITY_ID = :2';

110: CLOSE c_get_per;
111: END LOOP;
112: -- Update the source
113: /*
114: sql_stmt := 'UPDATE BSC_SYS_PERIODICITIES SET SOURCE = :1 WHERE PERIODICITY_ID = :2';
115: EXECUTE IMMEDIATE sql_stmt USING h_new_source, h_periodicity_id;
116: */
117: UPDATE BSC_SYS_PERIODICITIES
118: SET SOURCE = h_new_source

Line 117: UPDATE BSC_SYS_PERIODICITIES

113: /*
114: sql_stmt := 'UPDATE BSC_SYS_PERIODICITIES SET SOURCE = :1 WHERE PERIODICITY_ID = :2';
115: EXECUTE IMMEDIATE sql_stmt USING h_new_source, h_periodicity_id;
116: */
117: UPDATE BSC_SYS_PERIODICITIES
118: SET SOURCE = h_new_source
119: WHERE PERIODICITY_ID = h_periodicity_id;
120: END IF;
121: FETCH c_new_per INTO h_periodicity_id,h_source;

Line 1964: ' FROM bsc_sys_periodicities'||

1960: END IF;
1961:
1962: /*
1963: h_sql := 'SELECT calendar_id'||
1964: ' FROM bsc_sys_periodicities'||
1965: ' WHERE periodicity_id = :1';
1966: OPEN h_cursor FOR h_sql USING x_periodicity_id;
1967: FETCH h_cursor INTO h_calendar_id;
1968: CLOSE h_cursor;

Line 1972: FROM bsc_sys_periodicities

1968: CLOSE h_cursor;
1969: */
1970: SELECT calendar_id
1971: INTO h_calendar_id
1972: FROM bsc_sys_periodicities
1973: WHERE periodicity_id = x_periodicity_id;
1974:
1975: g_array_periodicities(x_periodicity_id).calendar_id := h_calendar_id;
1976:

Line 2100: ' FROM bsc_sys_periodicities'||

2096: END IF;
2097:
2098: /*
2099: h_sql := 'SELECT db_column_name'||
2100: ' FROM bsc_sys_periodicities'||
2101: ' WHERE periodicity_id = :1';
2102: OPEN h_cursor FOR h_sql USING x_periodicity_id;
2103: FETCH h_cursor INTO h_db_column_name;
2104: CLOSE h_cursor;

Line 2108: FROM bsc_sys_periodicities

2104: CLOSE h_cursor;
2105: */
2106: SELECT db_column_name
2107: INTO h_db_column_name
2108: FROM bsc_sys_periodicities
2109: WHERE periodicity_id = x_periodicity_id;
2110:
2111: g_array_periodicities(x_periodicity_id).db_column_name := h_db_column_name;
2112:

Line 2792: ' FROM bsc_sys_periodicities'||

2788:
2789: /*
2790: c_period_names t_cursor; -- x_periodicity_cod
2791: c_period_names_sql VARCHAR2(2000) := 'SELECT NVL(period_col_name, ''PERIOD''), subperiod_col_name'||
2792: ' FROM bsc_sys_periodicities'||
2793: ' WHERE periodicity_id = :1';
2794: */
2795: BEGIN
2796: IF g_array_periodicities.exists(x_periodicity_cod) THEN

Line 2816: FROM bsc_sys_periodicities

2812: */
2813: BEGIN
2814: SELECT NVL(period_col_name, 'PERIOD'), subperiod_col_name
2815: INTO x_period_col_name, x_subperiod_col_name
2816: FROM bsc_sys_periodicities
2817: WHERE periodicity_id = x_periodicity_cod;
2818: EXCEPTION
2819: WHEN NO_DATA_FOUND THEN
2820: x_period_col_name := NULL;

Line 2905: ' FROM bsc_sys_periodicities'||

2901: END IF;
2902:
2903: /*
2904: h_sql := 'SELECT edw_flag'||
2905: ' FROM bsc_sys_periodicities'||
2906: ' WHERE periodicity_id = :1';
2907: OPEN h_cursor FOR h_sql USING x_periodicity_id;
2908: FETCH h_cursor INTO h_edw_flag;
2909: CLOSE h_cursor;

Line 2913: FROM bsc_sys_periodicities

2909: CLOSE h_cursor;
2910: */
2911: SELECT edw_flag
2912: INTO h_edw_flag
2913: FROM bsc_sys_periodicities
2914: WHERE periodicity_id = x_periodicity_id;
2915:
2916: g_array_periodicities(x_periodicity_id).edw_flag := h_edw_flag;
2917:

Line 2946: ' FROM bsc_sys_periodicities'||

2942: END IF;
2943:
2944: /*
2945: h_sql := 'SELECT periodicity_type'||
2946: ' FROM bsc_sys_periodicities'||
2947: ' WHERE periodicity_id = :1';
2948: OPEN h_cursor FOR h_sql USING x_periodicity_id;
2949: FETCH h_cursor INTO h_periodicity_type;
2950: CLOSE h_cursor;

Line 2954: FROM bsc_sys_periodicities

2950: CLOSE h_cursor;
2951: */
2952: SELECT periodicity_type
2953: INTO h_periodicity_type
2954: FROM bsc_sys_periodicities
2955: WHERE periodicity_id = x_periodicity_id;
2956:
2957: g_array_periodicities(x_periodicity_id).periodicity_type := h_periodicity_type;
2958:

Line 2987: ' FROM bsc_sys_periodicities'||

2983: END IF;
2984:
2985: /*
2986: h_sql := 'SELECT yearly_flag'||
2987: ' FROM bsc_sys_periodicities'||
2988: ' WHERE periodicity_id = :1';
2989: OPEN h_cursor FOR h_sql USING x_periodicity_id;
2990: FETCH h_cursor INTO h_yearly_flag;
2991: CLOSE h_cursor;

Line 2995: FROM bsc_sys_periodicities

2991: CLOSE h_cursor;
2992: */
2993: SELECT yearly_flag
2994: INTO h_yearly_flag
2995: FROM bsc_sys_periodicities
2996: WHERE periodicity_id = x_periodicity_id;
2997:
2998: g_array_periodicities(x_periodicity_id).yearly_flag := h_yearly_flag;
2999:

Line 3358: FROM bsc_sys_periodicities

3354:
3355: --Fix bug#4063282, add source periodicity to this cursor
3356: CURSOR c_custom_pers (p_calendar_id NUMBER) IS
3357: SELECT periodicity_id, custom_code, DECODE(INSTR(source, ','), 0, source, SUBSTR(source, 1, INSTR(source, ',') - 1))
3358: FROM bsc_sys_periodicities
3359: WHERE calendar_id = p_calendar_id;
3360:
3361: h_periodicity_id NUMBER;
3362: h_custom_code NUMBER;

Line 3400: -- Fix bug#4536286: validate source and db_column_name in bsc_sys_periodicities

3396: -- END IF;
3397: --END IF;
3398:
3399:
3400: -- Fix bug#4536286: validate source and db_column_name in bsc_sys_periodicities
3401: -- cannot be null for custom periodicities
3402: select count(periodicity_id)
3403: into h_count
3404: from bsc_sys_periodicities

Line 3404: from bsc_sys_periodicities

3400: -- Fix bug#4536286: validate source and db_column_name in bsc_sys_periodicities
3401: -- cannot be null for custom periodicities
3402: select count(periodicity_id)
3403: into h_count
3404: from bsc_sys_periodicities
3405: where calendar_id = x_calendar_id and nvl(custom_code, -1) <> 0 and
3406: (source is null or db_column_name is null);
3407: IF h_count > 0 THEN
3408: RAISE e_unexpected_error;

Line 3738: FROM BSC_SYS_PERIODICITIES

3734: h_sql VARCHAR2(32000);
3735:
3736: CURSOR c_per_rels IS
3737: SELECT PERIODICITY_ID, SOURCE
3738: FROM BSC_SYS_PERIODICITIES
3739: ORDER BY PERIODICITY_ID;
3740:
3741: h_periodicity_id NUMBER;
3742: h_source VARCHAR2(500);

Line 4110: ' FROM bsc_sys_periodicities'||

4106: ' nvl(max(previous_years), 1)'||
4107: ' FROM bsc_db_tables'||
4108: ' WHERE table_type <> :1 AND nvl(num_of_years, 0) > :2 AND'||
4109: ' periodicity_id IN (SELECT periodicity_id'||
4110: ' FROM bsc_sys_periodicities'||
4111: ' WHERE calendar_id = :3)';
4112: */
4113: CURSOR get_range_yr (p_table_type NUMBER, p_num_of_years NUMBER, p_calendar_id NUMBER) IS
4114: SELECT nvl(max(num_of_years - previous_years), 1), nvl(max(previous_years), 1)

Line 4119: FROM bsc_sys_periodicities

4115: FROM bsc_db_tables
4116: WHERE table_type <> p_table_type AND nvl(num_of_years, 0) > p_num_of_years AND
4117: periodicity_id IN (
4118: SELECT periodicity_id
4119: FROM bsc_sys_periodicities
4120: WHERE calendar_id = p_calendar_id);
4121:
4122:
4123: h_message VARCHAR2(4000);

Line 4314: FROM bsc_sys_periodicities

4310: TYPE t_cursor IS REF CURSOR;
4311:
4312: CURSOR c_custom_pers (p_calendar_id NUMBER, p_custom_code NUMBER) IS
4313: SELECT periodicity_id, db_column_name
4314: FROM bsc_sys_periodicities
4315: WHERE calendar_id = p_calendar_id AND custom_code <> p_custom_code;
4316:
4317: h_periodicity_id NUMBER;
4318: h_db_column_name VARCHAR2(50);

Line 4328: FROM BSC_SYS_PERIODICITIES

4324: -- Delete all rows from bsc_sys_periods_tl
4325: DELETE FROM BSC_SYS_PERIODS_TL
4326: WHERE PERIODICITY_ID IN (
4327: SELECT PERIODICITY_ID
4328: FROM BSC_SYS_PERIODICITIES
4329: WHERE CALENDAR_ID = x_calendar_id);
4330:
4331:
4332: -- A. LABELS FOR PREDEFINED PERIODICITIES

Line 4354: BSC_SYS_PERIODICITIES P

4350: C.CALENDAR_MONTH||';'||C2.CALENDAR_MONTH AS NAME
4351: FROM
4352: BSC_DB_CALENDAR C,
4353: BSC_DB_CALENDAR C2,
4354: BSC_SYS_PERIODICITIES P
4355: WHERE
4356: P.CALENDAR_ID = x_calendar_id AND
4357: P.PERIODICITY_TYPE = 2 AND
4358: C.YEAR = C2.YEAR AND

Line 4381: BSC_SYS_PERIODICITIES P

4377: C.CALENDAR_MONTH||';'||C2.CALENDAR_MONTH AS NAME
4378: FROM
4379: BSC_DB_CALENDAR C,
4380: BSC_DB_CALENDAR C2,
4381: BSC_SYS_PERIODICITIES P
4382: WHERE
4383: P.CALENDAR_ID = x_calendar_id AND
4384: P.PERIODICITY_TYPE = 3 AND
4385: C.YEAR = C2.YEAR AND

Line 4408: BSC_SYS_PERIODICITIES P

4404: C.CALENDAR_MONTH||';'||C2.CALENDAR_MONTH AS NAME
4405: FROM
4406: BSC_DB_CALENDAR C,
4407: BSC_DB_CALENDAR C2,
4408: BSC_SYS_PERIODICITIES P
4409: WHERE
4410: P.CALENDAR_ID = x_calendar_id AND
4411: P.PERIODICITY_TYPE = 4 AND
4412: C.YEAR = C2.YEAR AND

Line 4434: BSC_SYS_PERIODICITIES P

4430: C.MONTH AS PERIOD_ID,
4431: TO_CHAR(C.CALENDAR_MONTH) AS NAME
4432: FROM
4433: BSC_DB_CALENDAR C,
4434: BSC_SYS_PERIODICITIES P
4435: WHERE
4436: P.CALENDAR_ID = x_calendar_id AND
4437: P.PERIODICITY_TYPE = 5 AND
4438: C.CALENDAR_ID = P.CALENDAR_ID

Line 4448: BSC_SYS_PERIODICITIES P

4444: C.WEEK52 AS PERIOD_ID,
4445: C.CALENDAR_MONTH||';'||C.CALENDAR_DAY AS NAME
4446: FROM
4447: BSC_DB_CALENDAR C,
4448: BSC_SYS_PERIODICITIES P
4449: WHERE
4450: P.CALENDAR_ID = x_calendar_id AND
4451: C.CALENDAR_ID = P.CALENDAR_ID AND
4452: P.PERIODICITY_TYPE = 7 AND

Line 4466: BSC_SYS_PERIODICITIES P

4462: C.DAY365 AS PERIOD_ID,
4463: C.CALENDAR_MONTH||';'||C.CALENDAR_DAY AS NAME
4464: FROM
4465: BSC_DB_CALENDAR C,
4466: BSC_SYS_PERIODICITIES P
4467: WHERE
4468: P.CALENDAR_ID = x_calendar_id AND
4469: P.PERIODICITY_TYPE = 9 AND
4470: C.CALENDAR_ID = P.CALENDAR_ID) CA, FND_LANGUAGES L WHERE L.INSTALLED_FLAG <> 'D';

Line 4951: ' FROM BSC_SYS_PERIODICITIES'||

4947:
4948: /*
4949: c_new_per t_cursor; -- x_calendar_id, 1
4950: c_new_per_sql VARCHAR2(2000) := 'SELECT SOURCE'||
4951: ' FROM BSC_SYS_PERIODICITIES'||
4952: ' WHERE CALENDAR_ID = :1 AND PERIODICITY_TYPE = :2'||
4953: ' ORDER BY PERIODICITY_ID';
4954: */
4955: CURSOR c_new_per (p_calendar_id NUMBER, p_periodicity_type NUMBER) IS

Line 4957: FROM BSC_SYS_PERIODICITIES

4953: ' ORDER BY PERIODICITY_ID';
4954: */
4955: CURSOR c_new_per (p_calendar_id NUMBER, p_periodicity_type NUMBER) IS
4956: SELECT SOURCE
4957: FROM BSC_SYS_PERIODICITIES
4958: WHERE CALENDAR_ID = p_calendar_id AND PERIODICITY_TYPE = p_periodicity_type
4959: ORDER BY PERIODICITY_ID;
4960:
4961: h_source VARCHAR2(200);

Line 5013: h_sql := 'UPDATE BSC_SYS_PERIODICITIES SET SOURCE = :1'||

5009: END IF;
5010:
5011: -- Update the source
5012: /*
5013: h_sql := 'UPDATE BSC_SYS_PERIODICITIES SET SOURCE = :1'||
5014: ' WHERE CALENDAR_ID = :2 AND PERIODICITY_TYPE = :3';
5015: EXECUTE IMMEDIATE h_sql USING h_new_source, x_calendar_id, 1;
5016: */
5017: UPDATE BSC_SYS_PERIODICITIES SET SOURCE = h_new_source

Line 5017: UPDATE BSC_SYS_PERIODICITIES SET SOURCE = h_new_source

5013: h_sql := 'UPDATE BSC_SYS_PERIODICITIES SET SOURCE = :1'||
5014: ' WHERE CALENDAR_ID = :2 AND PERIODICITY_TYPE = :3';
5015: EXECUTE IMMEDIATE h_sql USING h_new_source, x_calendar_id, 1;
5016: */
5017: UPDATE BSC_SYS_PERIODICITIES SET SOURCE = h_new_source
5018: WHERE CALENDAR_ID = x_calendar_id AND PERIODICITY_TYPE = 1;
5019:
5020: ELSE
5021: IF x_action = 1 THEN

Line 5025: h_sql := 'UPDATE BSC_SYS_PERIODICITIES SET SOURCE = :1'||

5021: IF x_action = 1 THEN
5022: h_new_source := x_periodicity_id ;
5023: -- Update the source
5024: /*
5025: h_sql := 'UPDATE BSC_SYS_PERIODICITIES SET SOURCE = :1'||
5026: ' WHERE CALENDAR_ID = :2 AND PERIODICITY_TYPE = :3';
5027: EXECUTE IMMEDIATE h_sql USING h_new_source, x_calendar_id, 1;
5028: */
5029: UPDATE BSC_SYS_PERIODICITIES SET SOURCE = h_new_source

Line 5029: UPDATE BSC_SYS_PERIODICITIES SET SOURCE = h_new_source

5025: h_sql := 'UPDATE BSC_SYS_PERIODICITIES SET SOURCE = :1'||
5026: ' WHERE CALENDAR_ID = :2 AND PERIODICITY_TYPE = :3';
5027: EXECUTE IMMEDIATE h_sql USING h_new_source, x_calendar_id, 1;
5028: */
5029: UPDATE BSC_SYS_PERIODICITIES SET SOURCE = h_new_source
5030: WHERE CALENDAR_ID = x_calendar_id AND PERIODICITY_TYPE = 1;
5031: END IF;
5032: END IF;
5033: END IF;

Line 5101: BSC_SYS_PERIODICITIES P,

5097: D.LANGUAGE = L.LANGUAGE
5098: ))
5099: FROM
5100: BSC_DB_COLOR_KPI_V K,
5101: BSC_SYS_PERIODICITIES P,
5102: BSC_SYS_CALENDARS_B C
5103: WHERE
5104: K.TAB_ID = D.TAB_ID AND
5105: K.INDICATOR = D.INDICATOR AND

Line 5142: BSC_SYS_PERIODICITIES P,

5138: D.LANGUAGE = L.LANGUAGE
5139: ))
5140: FROM
5141: BSC_DB_COLOR_KPI_V K,
5142: BSC_SYS_PERIODICITIES P,
5143: BSC_SYS_CALENDARS_B C
5144: WHERE
5145: K.TAB_ID = D.TAB_ID AND
5146: K.INDICATOR = D.INDICATOR AND

Line 5480: FROM bsc_sys_periodicities

5476: h_model_year NUMBER;
5477:
5478: CURSOR c_source_periodicity (p_periodicity_id NUMBER) IS
5479: SELECT DECODE(INSTR(source, ','), 0, source, SUBSTR(source, 1, INSTR(source, ',') - 1))
5480: FROM bsc_sys_periodicities
5481: WHERE periodicity_id = p_periodicity_id;
5482:
5483: h_source_periodicity NUMBER;
5484: