145: return false;
146: end if;
147: end if;
148:
149: if BSC_IM_UTILS.parse_values(p_option_string,',',g_options,g_number_options)=false then
150: p_error_message:=BSC_IM_UTILS.g_status_message;
151: return false;
152: end if;
153: if init_all(g_options,g_number_options)=false then
146: end if;
147: end if;
148:
149: if BSC_IM_UTILS.parse_values(p_option_string,',',g_options,g_number_options)=false then
150: p_error_message:=BSC_IM_UTILS.g_status_message;
151: return false;
152: end if;
153: if init_all(g_options,g_number_options)=false then
154: p_error_message:=BSC_IM_UTILS.g_status_message;
150: p_error_message:=BSC_IM_UTILS.g_status_message;
151: return false;
152: end if;
153: if init_all(g_options,g_number_options)=false then
154: p_error_message:=BSC_IM_UTILS.g_status_message;
155: return false;
156: end if;
157: if g_debug then
158: write_to_log_file_n('================================================');
159: write_to_log_file('Implement BSC MV '||p_kpi);
160: write_to_log_file_n('================================================');
161: end if;
162: if BSC_BSC_ADAPTER.load_metadata_for_indicators(p_kpi,g_options,g_number_options)=false then
163: p_error_message:=BSC_IM_UTILS.g_status_message;
164: return false;
165: end if;
166: if BSC_MV_ADAPTER.create_mv_kpi(p_kpi,'BSC',g_options,g_number_options)=false then
167: p_error_message:=BSC_IM_UTILS.g_status_message;
163: p_error_message:=BSC_IM_UTILS.g_status_message;
164: return false;
165: end if;
166: if BSC_MV_ADAPTER.create_mv_kpi(p_kpi,'BSC',g_options,g_number_options)=false then
167: p_error_message:=BSC_IM_UTILS.g_status_message;
168: return false;
169: end if;
170: return true;
171: Exception when others then
168: return false;
169: end if;
170: return true;
171: Exception when others then
172: BSC_IM_UTILS.g_status_message:=sqlerrm;
173: write_to_log_file_n('Error in implement_bsc_mv '||sqlerrm);
174: p_error_message:=BSC_IM_UTILS.g_status_message;
175: return false;
176: End;
170: return true;
171: Exception when others then
172: BSC_IM_UTILS.g_status_message:=sqlerrm;
173: write_to_log_file_n('Error in implement_bsc_mv '||sqlerrm);
174: p_error_message:=BSC_IM_UTILS.g_status_message;
175: return false;
176: End;
177:
178: ----------------------------------------------------------
182: p_error_message out nocopy varchar2)return boolean is
183: Begin
184: open_file;
185: reset;
186: if BSC_IM_UTILS.parse_values(p_option_string,',',g_options,g_number_options)=false then
187: p_error_message:=BSC_IM_UTILS.g_status_message;
188: return false;
189: end if;
190: if init_all(g_options,g_number_options)=false then
183: Begin
184: open_file;
185: reset;
186: if BSC_IM_UTILS.parse_values(p_option_string,',',g_options,g_number_options)=false then
187: p_error_message:=BSC_IM_UTILS.g_status_message;
188: return false;
189: end if;
190: if init_all(g_options,g_number_options)=false then
191: p_error_message:=BSC_IM_UTILS.g_status_message;
187: p_error_message:=BSC_IM_UTILS.g_status_message;
188: return false;
189: end if;
190: if init_all(g_options,g_number_options)=false then
191: p_error_message:=BSC_IM_UTILS.g_status_message;
192: return false;
193: end if;
194: if BSC_BSC_ADAPTER.load_metadata_for_indicators(p_kpi,g_options,g_number_options)=false then
195: p_error_message:=BSC_IM_UTILS.g_status_message;
191: p_error_message:=BSC_IM_UTILS.g_status_message;
192: return false;
193: end if;
194: if BSC_BSC_ADAPTER.load_metadata_for_indicators(p_kpi,g_options,g_number_options)=false then
195: p_error_message:=BSC_IM_UTILS.g_status_message;
196: return false;
197: end if;
198: if BSC_MV_ADAPTER.drop_mv_kpi(p_kpi,'BSC',g_options,g_number_options)=false then
199: p_error_message:=BSC_MV_ADAPTER.g_status_message;
199: p_error_message:=BSC_MV_ADAPTER.g_status_message;
200: end if;
201: return true;
202: Exception when others then
203: BSC_IM_UTILS.g_status_message:=sqlerrm;
204: write_to_log_file_n('Error in drop_bsc_mv '||sqlerrm);
205: p_error_message:=BSC_IM_UTILS.g_status_message;
206: return false;
207: End;
201: return true;
202: Exception when others then
203: BSC_IM_UTILS.g_status_message:=sqlerrm;
204: write_to_log_file_n('Error in drop_bsc_mv '||sqlerrm);
205: p_error_message:=BSC_IM_UTILS.g_status_message;
206: return false;
207: End;
208:
209: function drop_summary_mv(
210: p_mv varchar2,
211: p_option_string varchar2,
212: p_error_message out nocopy varchar2)return boolean is
213: Begin
214: if BSC_IM_UTILS.parse_values(p_option_string,',',g_options,g_number_options)=false then
215: p_error_message:=BSC_IM_UTILS.g_status_message;
216: return false;
217: end if;
218: if BSC_MV_ADAPTER.drop_mv(p_mv,g_options,g_number_options)=false then
211: p_option_string varchar2,
212: p_error_message out nocopy varchar2)return boolean is
213: Begin
214: if BSC_IM_UTILS.parse_values(p_option_string,',',g_options,g_number_options)=false then
215: p_error_message:=BSC_IM_UTILS.g_status_message;
216: return false;
217: end if;
218: if BSC_MV_ADAPTER.drop_mv(p_mv,g_options,g_number_options)=false then
219: p_error_message:=BSC_MV_ADAPTER.g_status_message;
219: p_error_message:=BSC_MV_ADAPTER.g_status_message;
220: end if;
221: return true;
222: Exception when others then
223: BSC_IM_UTILS.g_status_message:=sqlerrm;
224: write_to_log_file_n('Error in drop_bsc_mv '||sqlerrm);
225: p_error_message:=BSC_IM_UTILS.g_status_message;
226: return false;
227: End;
221: return true;
222: Exception when others then
223: BSC_IM_UTILS.g_status_message:=sqlerrm;
224: write_to_log_file_n('Error in drop_bsc_mv '||sqlerrm);
225: p_error_message:=BSC_IM_UTILS.g_status_message;
226: return false;
227: End;
228: ----------------------------------------------------------
229:
234: p_error_message out nocopy varchar2)return boolean is
235: Begin
236: open_file;
237: reset;
238: if BSC_IM_UTILS.parse_values(p_option_string,',',g_options,g_number_options)=false then
239: p_error_message:=BSC_IM_UTILS.g_status_message;
240: return false;
241: end if;
242: if init_all(g_options,g_number_options)=false then
235: Begin
236: open_file;
237: reset;
238: if BSC_IM_UTILS.parse_values(p_option_string,',',g_options,g_number_options)=false then
239: p_error_message:=BSC_IM_UTILS.g_status_message;
240: return false;
241: end if;
242: if init_all(g_options,g_number_options)=false then
243: p_error_message:=BSC_IM_UTILS.g_status_message;
239: p_error_message:=BSC_IM_UTILS.g_status_message;
240: return false;
241: end if;
242: if init_all(g_options,g_number_options)=false then
243: p_error_message:=BSC_IM_UTILS.g_status_message;
244: return false;
245: end if;
246: if g_debug then
247: write_to_log_file_n('================================================');
248: write_to_log_file('Refresh BSC MV '||p_kpi);
249: write_to_log_file_n('================================================');
250: end if;
251: if BSC_BSC_ADAPTER.load_metadata_for_indicators(p_kpi,g_options,g_number_options)=false then
252: p_error_message:=BSC_IM_UTILS.g_status_message;
253: return false;
254: end if;
255: if BSC_MV_ADAPTER.refresh_mv_kpi(p_kpi,'BSC',g_options,g_number_options)=false then
256: p_error_message:=BSC_MV_ADAPTER.g_status_message;
257: return false;
258: end if;
259: return true;
260: Exception when others then
261: BSC_IM_UTILS.g_status_message:=sqlerrm;
262: write_to_log_file_n('Error in refresh_bsc_mv '||sqlerrm);
263: p_error_message:=BSC_IM_UTILS.g_status_message;
264: return false;
265: End;
259: return true;
260: Exception when others then
261: BSC_IM_UTILS.g_status_message:=sqlerrm;
262: write_to_log_file_n('Error in refresh_bsc_mv '||sqlerrm);
263: p_error_message:=BSC_IM_UTILS.g_status_message;
264: return false;
265: End;
266:
267: function refresh_summary_mv(
270: p_option_string varchar2,
271: p_error_message out nocopy varchar2)return boolean is
272: Begin
273: open_file;
274: if BSC_IM_UTILS.parse_values(p_option_string,',',g_options,g_number_options)=false then
275: p_error_message:=BSC_IM_UTILS.g_status_message;
276: return false;
277: end if;
278: if init_all(g_options,g_number_options)=false then
271: p_error_message out nocopy varchar2)return boolean is
272: Begin
273: open_file;
274: if BSC_IM_UTILS.parse_values(p_option_string,',',g_options,g_number_options)=false then
275: p_error_message:=BSC_IM_UTILS.g_status_message;
276: return false;
277: end if;
278: if init_all(g_options,g_number_options)=false then
279: p_error_message:=BSC_IM_UTILS.g_status_message;
275: p_error_message:=BSC_IM_UTILS.g_status_message;
276: return false;
277: end if;
278: if init_all(g_options,g_number_options)=false then
279: p_error_message:=BSC_IM_UTILS.g_status_message;
280: return false;
281: end if;
282: if g_debug then
283: write_to_log_file_n('================================================');
286: end if;
287: -- Bug#3899842: Performance fix: Comment out these lines.
288: --Instead call BSC_BSC_ADAPTER.create_int_md_fk(p_mv)
289: /*
290: if BSC_IM_UTILS.is_cube_present(p_kpi,'BSC')=false then
291: --see if any cube is present.
292: if BSC_IM_UTILS.is_cube_present(null,'BSC') then
293: reset;
294: end if;
288: --Instead call BSC_BSC_ADAPTER.create_int_md_fk(p_mv)
289: /*
290: if BSC_IM_UTILS.is_cube_present(p_kpi,'BSC')=false then
291: --see if any cube is present.
292: if BSC_IM_UTILS.is_cube_present(null,'BSC') then
293: reset;
294: end if;
295: --populate the int metadata
296: if BSC_BSC_ADAPTER.load_metadata_for_indicators(p_kpi,g_options,g_number_options)=false then
293: reset;
294: end if;
295: --populate the int metadata
296: if BSC_BSC_ADAPTER.load_metadata_for_indicators(p_kpi,g_options,g_number_options)=false then
297: p_error_message:=BSC_IM_UTILS.g_status_message;
298: return false;
299: end if;
300: end if;
301: */
305: return false;
306: end if;
307: return true;
308: Exception when others then
309: BSC_IM_UTILS.g_status_message:=sqlerrm;
310: write_to_log_file_n('Error in refresh_bsc_mv '||sqlerrm);
311: p_error_message:=BSC_IM_UTILS.g_status_message;
312: return false;
313: End;
307: return true;
308: Exception when others then
309: BSC_IM_UTILS.g_status_message:=sqlerrm;
310: write_to_log_file_n('Error in refresh_bsc_mv '||sqlerrm);
311: p_error_message:=BSC_IM_UTILS.g_status_message;
312: return false;
313: End;
314: ------------------------------------------
315: --------=====================================
320: p_error_message out nocopy varchar2)return boolean is
321: Begin
322: open_file;
323: reset;
324: if BSC_IM_UTILS.parse_values(p_option_string,',',g_options,g_number_options)=false then
325: p_error_message:=BSC_IM_UTILS.g_status_message;
326: return false;
327: end if;
328: if init_all(g_options,g_number_options)=false then
321: Begin
322: open_file;
323: reset;
324: if BSC_IM_UTILS.parse_values(p_option_string,',',g_options,g_number_options)=false then
325: p_error_message:=BSC_IM_UTILS.g_status_message;
326: return false;
327: end if;
328: if init_all(g_options,g_number_options)=false then
329: p_error_message:=BSC_IM_UTILS.g_status_message;
325: p_error_message:=BSC_IM_UTILS.g_status_message;
326: return false;
327: end if;
328: if init_all(g_options,g_number_options)=false then
329: p_error_message:=BSC_IM_UTILS.g_status_message;
330: return false;
331: end if;
332: if g_debug then
333: write_to_log_file_n('================================================');
335: write_to_log_file_n('================================================');
336: end if;
337: if p_apps='BSC' then
338: if BSC_BSC_ADAPTER.load_reporting_calendar(g_options,g_number_options)=false then
339: p_error_message:=BSC_IM_UTILS.g_status_message;
340: return false;
341: end if;
342: end if;
343: return true;
341: end if;
342: end if;
343: return true;
344: Exception when others then
345: BSC_IM_UTILS.g_status_message:=sqlerrm;
346: write_to_log_file_n('Error in load_reporting_calendar '||sqlerrm);
347: p_error_message:=BSC_IM_UTILS.g_status_message;
348: return false;
349: End;
343: return true;
344: Exception when others then
345: BSC_IM_UTILS.g_status_message:=sqlerrm;
346: write_to_log_file_n('Error in load_reporting_calendar '||sqlerrm);
347: p_error_message:=BSC_IM_UTILS.g_status_message;
348: return false;
349: End;
350:
351: --Fix bug#4027813: Added this function to load reporting calendar for only
357: p_error_message out nocopy varchar2)return boolean is
358: Begin
359: open_file;
360: reset;
361: if BSC_IM_UTILS.parse_values(p_option_string,',',g_options,g_number_options)=false then
362: p_error_message:=BSC_IM_UTILS.g_status_message;
363: return false;
364: end if;
365: if init_all(g_options,g_number_options)=false then
358: Begin
359: open_file;
360: reset;
361: if BSC_IM_UTILS.parse_values(p_option_string,',',g_options,g_number_options)=false then
362: p_error_message:=BSC_IM_UTILS.g_status_message;
363: return false;
364: end if;
365: if init_all(g_options,g_number_options)=false then
366: p_error_message:=BSC_IM_UTILS.g_status_message;
362: p_error_message:=BSC_IM_UTILS.g_status_message;
363: return false;
364: end if;
365: if init_all(g_options,g_number_options)=false then
366: p_error_message:=BSC_IM_UTILS.g_status_message;
367: return false;
368: end if;
369: if g_debug then
370: write_to_log_file_n('================================================');
372: write_to_log_file_n('================================================');
373: end if;
374: if p_apps='BSC' then
375: if BSC_BSC_ADAPTER.load_reporting_calendar(p_calendar_id, g_options,g_number_options)=false then
376: p_error_message:=BSC_IM_UTILS.g_status_message;
377: return false;
378: end if;
379: end if;
380: return true;
378: end if;
379: end if;
380: return true;
381: Exception when others then
382: BSC_IM_UTILS.g_status_message:=sqlerrm;
383: write_to_log_file_n('Error in load_reporting_calendar '||sqlerrm);
384: p_error_message:=BSC_IM_UTILS.g_status_message;
385: return false;
386: End;
380: return true;
381: Exception when others then
382: BSC_IM_UTILS.g_status_message:=sqlerrm;
383: write_to_log_file_n('Error in load_reporting_calendar '||sqlerrm);
384: p_error_message:=BSC_IM_UTILS.g_status_message;
385: return false;
386: End;
387: --------=====================================
388:
395: p_error_message out nocopy varchar2) is
396: Begin
397: bsc_bsc_adapter.get_list_of_rec_dim(p_dim_list,p_num_dim_list,p_error_message);
398: Exception when others then
399: BSC_IM_UTILS.g_status_message:=sqlerrm;
400: p_error_message:=BSC_IM_UTILS.g_status_message;
401: raise;
402: End;
403:
396: Begin
397: bsc_bsc_adapter.get_list_of_rec_dim(p_dim_list,p_num_dim_list,p_error_message);
398: Exception when others then
399: BSC_IM_UTILS.g_status_message:=sqlerrm;
400: p_error_message:=BSC_IM_UTILS.g_status_message;
401: raise;
402: End;
403:
404: procedure set_and_get_dim_sql(
411: Begin
412: bsc_bsc_adapter.set_and_get_dim_sql(p_dim_level_short_name,p_dim_level_value,p_num_dim_level,
413: p_dim_level_sql,p_error_message);
414: Exception when others then
415: BSC_IM_UTILS.g_status_message:=sqlerrm;
416: p_error_message:=BSC_IM_UTILS.g_status_message;
417: raise;
418: End;
419:
412: bsc_bsc_adapter.set_and_get_dim_sql(p_dim_level_short_name,p_dim_level_value,p_num_dim_level,
413: p_dim_level_sql,p_error_message);
414: Exception when others then
415: BSC_IM_UTILS.g_status_message:=sqlerrm;
416: p_error_message:=BSC_IM_UTILS.g_status_message;
417: raise;
418: End;
419:
420: --------=====================================
423: Begin
424: write_to_log_file_n('Intermediate metadata reset');
425: BSC_IM_INT_MD.reset_int_metadata;
426: Exception when others then
427: BSC_IM_UTILS.g_status_message:=sqlerrm;
428: write_to_log_file_n('Error in reset '||sqlerrm);
429: raise;
430: End;
431:
430: End;
431:
432: procedure open_file is
433: Begin
434: BSC_IM_UTILS.open_file('TEST');
435: Exception when others then
436: BSC_IM_UTILS.g_status_message:=sqlerrm;
437: write_to_log_file_n('Error in open_file '||sqlerrm);
438: raise;
432: procedure open_file is
433: Begin
434: BSC_IM_UTILS.open_file('TEST');
435: Exception when others then
436: BSC_IM_UTILS.g_status_message:=sqlerrm;
437: write_to_log_file_n('Error in open_file '||sqlerrm);
438: raise;
439: End;
440:
439: End;
440:
441: ------------------------------------------
442: function init_all(
443: p_options BSC_IM_UTILS.varchar_tabletype,
444: p_number_options number) return boolean is
445: Begin
446: g_init_all:='set';
447: g_status:=true;
445: Begin
446: g_init_all:='set';
447: g_status:=true;
448: g_debug:=false;
449: if BSC_IM_UTILS.get_option_value(p_options,p_number_options,'DEBUG LOG')='Y' then
450: g_debug:=true;
451: end if;
452: if BSC_IM_UTILS.get_option_value(p_options,p_number_options,'TRACE')='Y' then
453: BSC_IM_UTILS.set_trace;
448: g_debug:=false;
449: if BSC_IM_UTILS.get_option_value(p_options,p_number_options,'DEBUG LOG')='Y' then
450: g_debug:=true;
451: end if;
452: if BSC_IM_UTILS.get_option_value(p_options,p_number_options,'TRACE')='Y' then
453: BSC_IM_UTILS.set_trace;
454: end if;
455: BSC_IM_UTILS.set_globals(g_debug);
456: if BSC_IM_UTILS.set_global_dimensions=false then
449: if BSC_IM_UTILS.get_option_value(p_options,p_number_options,'DEBUG LOG')='Y' then
450: g_debug:=true;
451: end if;
452: if BSC_IM_UTILS.get_option_value(p_options,p_number_options,'TRACE')='Y' then
453: BSC_IM_UTILS.set_trace;
454: end if;
455: BSC_IM_UTILS.set_globals(g_debug);
456: if BSC_IM_UTILS.set_global_dimensions=false then
457: return false;
451: end if;
452: if BSC_IM_UTILS.get_option_value(p_options,p_number_options,'TRACE')='Y' then
453: BSC_IM_UTILS.set_trace;
454: end if;
455: BSC_IM_UTILS.set_globals(g_debug);
456: if BSC_IM_UTILS.set_global_dimensions=false then
457: return false;
458: end if;
459: BSC_BSC_ADAPTER.set_globals(g_debug);
452: if BSC_IM_UTILS.get_option_value(p_options,p_number_options,'TRACE')='Y' then
453: BSC_IM_UTILS.set_trace;
454: end if;
455: BSC_IM_UTILS.set_globals(g_debug);
456: if BSC_IM_UTILS.set_global_dimensions=false then
457: return false;
458: end if;
459: BSC_BSC_ADAPTER.set_globals(g_debug);
460: BSC_IM_INT_MD.set_globals(g_debug);
460: BSC_IM_INT_MD.set_globals(g_debug);
461: BSC_MV_ADAPTER.set_globals(g_debug);
462: return true;
463: Exception when others then
464: BSC_IM_UTILS.g_status_message:=sqlerrm;
465: write_to_log_file_n('Error in init_all '||sqlerrm);
466: return false;
467: End;
468:
467: End;
468:
469: procedure write_to_log_file(p_message varchar2) is
470: Begin
471: BSC_IM_UTILS.write_to_log_file(p_message);
472: Exception when others then
473: BSC_IM_UTILS.g_status_message:=sqlerrm;
474: null;
475: End;
469: procedure write_to_log_file(p_message varchar2) is
470: Begin
471: BSC_IM_UTILS.write_to_log_file(p_message);
472: Exception when others then
473: BSC_IM_UTILS.g_status_message:=sqlerrm;
474: null;
475: End;
476:
477: procedure write_to_log_file_n(p_message varchar2) is
478: begin
479: write_to_log_file(' ');
480: write_to_log_file(p_message);
481: Exception when others then
482: BSC_IM_UTILS.g_status_message:=sqlerrm;
483: null;
484: end;
485:
486: procedure write_to_debug_n(p_message varchar2) is
488: if g_debug then
489: write_to_log_file_n(p_message);
490: end if;
491: Exception when others then
492: BSC_IM_UTILS.g_status_message:=sqlerrm;
493: null;
494: end;
495:
496: procedure write_to_debug(p_message varchar2) is
498: if g_debug then
499: write_to_log_file(p_message);
500: end if;
501: Exception when others then
502: BSC_IM_UTILS.g_status_message:=sqlerrm;
503: null;
504: end;
505:
506: function get_time return varchar2 is
504: end;
505:
506: function get_time return varchar2 is
507: begin
508: return BSC_IM_UTILS.get_time;
509: Exception when others then
510: BSC_IM_UTILS.g_status_message:=sqlerrm;
511: null;
512: End;
506: function get_time return varchar2 is
507: begin
508: return BSC_IM_UTILS.get_time;
509: Exception when others then
510: BSC_IM_UTILS.g_status_message:=sqlerrm;
511: null;
512: End;
513:
514: END BSC_OLAP_MAIN;