DBA Data[Home] [Help]

APPS.BSC_MO_LOADER_CONFIG_PKG dependencies on BSC_MO_HELPER_PKG

Line 35: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gTables, p_table_name);

31: and tbl.table_type = 0;
32:
33: l_table_type NUMBER;
34: BEGIN
35: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gTables, p_table_name);
36: If l_temp <> -1 AND BSC_METADATA_OPTIMIZER_PKG.gTables(l_temp).originTable IS NOT NULL Then
37: l_origin_table := BSC_MO_HELPER_PKG.getDecomposedString(BSC_METADATA_OPTIMIZER_PKG.gTables(l_temp).originTable, ',');
38: l_origin_name := l_origin_table(l_origin_table.first);
39: l_temp2 := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gTables, l_origin_name);

Line 37: l_origin_table := BSC_MO_HELPER_PKG.getDecomposedString(BSC_METADATA_OPTIMIZER_PKG.gTables(l_temp).originTable, ',');

33: l_table_type NUMBER;
34: BEGIN
35: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gTables, p_table_name);
36: If l_temp <> -1 AND BSC_METADATA_OPTIMIZER_PKG.gTables(l_temp).originTable IS NOT NULL Then
37: l_origin_table := BSC_MO_HELPER_PKG.getDecomposedString(BSC_METADATA_OPTIMIZER_PKG.gTables(l_temp).originTable, ',');
38: l_origin_name := l_origin_table(l_origin_table.first);
39: l_temp2 := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gTables, l_origin_name);
40: IF (l_temp2 = -1) THEN
41: OPEN cTableType;

Line 39: l_temp2 := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gTables, l_origin_name);

35: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gTables, p_table_name);
36: If l_temp <> -1 AND BSC_METADATA_OPTIMIZER_PKG.gTables(l_temp).originTable IS NOT NULL Then
37: l_origin_table := BSC_MO_HELPER_PKG.getDecomposedString(BSC_METADATA_OPTIMIZER_PKG.gTables(l_temp).originTable, ',');
38: l_origin_name := l_origin_table(l_origin_table.first);
39: l_temp2 := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gTables, l_origin_name);
40: IF (l_temp2 = -1) THEN
41: OPEN cTableType;
42: FETCH cTableType INTO l_table_type ;
43: CLOSE cTableType;

Line 67: bsc_mo_helper_pkg.writeTmp('Exception in isBasicTable:'||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);

63: END IF;
64: return False;
65: End If;
66: EXCEPTION WHEN OTHERS THEN
67: bsc_mo_helper_pkg.writeTmp('Exception in isBasicTable:'||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);
68: bsc_mo_helper_pkg.writeTmp('p_table_name = '||p_table_name||', l_temp = '||l_temp, FND_LOG.LEVEL_STATEMENT, true);
69: raise;
70: End ;
71:

Line 68: bsc_mo_helper_pkg.writeTmp('p_table_name = '||p_table_name||', l_temp = '||l_temp, FND_LOG.LEVEL_STATEMENT, true);

64: return False;
65: End If;
66: EXCEPTION WHEN OTHERS THEN
67: bsc_mo_helper_pkg.writeTmp('Exception in isBasicTable:'||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);
68: bsc_mo_helper_pkg.writeTmp('p_table_name = '||p_table_name||', l_temp = '||l_temp, FND_LOG.LEVEL_STATEMENT, true);
69: raise;
70: End ;
71:
72: --****************************************************************************

Line 95: l_groups := BSC_MO_HELPER_PKG.getGroupIds(colDimensions);

91: posicion := 0;
92: IF (colDimensions.count =0 ) THEN
93: return posicion;
94: END IF;
95: l_groups := BSC_MO_HELPER_PKG.getGroupIds(colDimensions);
96: l_index1 := l_groups.first;
97:
98: LOOP
99: l_levels := BSC_MO_HELPER_PKG.get_tab_clsLevels(colDimensions, l_groups(l_index1));

Line 99: l_levels := BSC_MO_HELPER_PKG.get_tab_clsLevels(colDimensions, l_groups(l_index1));

95: l_groups := BSC_MO_HELPER_PKG.getGroupIds(colDimensions);
96: l_index1 := l_groups.first;
97:
98: LOOP
99: l_levels := BSC_MO_HELPER_PKG.get_tab_clsLevels(colDimensions, l_groups(l_index1));
100: IF (l_levels.count >0) THEN
101: l_index2 := l_levels.first;
102: END IF;
103: LOOP

Line 120: bsc_mo_helper_pkg.writeTmp('Exception in GetPhantomLevelPosition:'||sqlerrm, FND_LOG.LEVEL_STATEMENT, true);

116: END LOOP;
117: return posicion;
118:
119: EXCEPTION WHEN OTHERS THEN
120: bsc_mo_helper_pkg.writeTmp('Exception in GetPhantomLevelPosition:'||sqlerrm, FND_LOG.LEVEL_STATEMENT, true);
121: raise;
122: End ;
123:
124:

Line 161: bsc_mo_helper_pkg.writeTmp('Exception in GetPhantomLevels:'||sqlerrm, FND_LOG.LEVEL_STATEMENT, true);

157: Close c1;
158: Return numPhantomLevels;
159:
160: EXCEPTION WHEN OTHERS THEN
161: bsc_mo_helper_pkg.writeTmp('Exception in GetPhantomLevels:'||sqlerrm, FND_LOG.LEVEL_STATEMENT, true);
162: raise;
163: End;
164:
165: --****************************************************************************

Line 216: bsc_mo_helper_pkg.writeTmp('# of phantom levels = '||numPhantomLevels);

212: EXIT WHEN colConfiguraciones.count = 0;
213: Configuracion := colConfiguraciones(l_index2);
214: numPhantomLevels := GetPhantomLevels(Indicator.Code, Configuracion, arrPhantomLevels);
215: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
216: bsc_mo_helper_pkg.writeTmp('# of phantom levels = '||numPhantomLevels);
217: END IF;
218: If numPhantomLevels > 0 Then
219: --Get the list of drills of the kpi in the given configuration
220: colDimensions := BSC_MO_INDICATOR_PKG.GetLevelCollection(Indicator.Code, Configuracion);

Line 237: bsc_mo_helper_pkg.writeTmp('UPDATE BSC_KPI_DATA_TABLES SET LEVEL_COMB = '||

233: substr(strDriles, levelPos - Length(strDriles) );
234: END LOOP;
235:
236: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
237: bsc_mo_helper_pkg.writeTmp('UPDATE BSC_KPI_DATA_TABLES SET LEVEL_COMB = '||
238: strDriles||' WHERE INDICATOR = '|| Indicator.Code||' AND DIM_SET_ID = '||
239: Configuracion||' AND PERIODICITY_ID = '|| l_periodicity_id||' AND LEVEL_COMB = '||strDrilesAnt, FND_LOG.LEVEL_STATEMENT);
240: END IF;
241:

Line 260: bsc_mo_helper_pkg.writeTmp('Exception in Corrections : '||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);

256: l_index1 := BSC_METADATA_OPTIMIZER_PKG.gIndicators.next(l_index1);
257: END LOOP;
258:
259: EXCEPTION WHEN OTHERS THEN
260: bsc_mo_helper_pkg.writeTmp('Exception in Corrections : '||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);
261: bsc_mo_helper_pkg.terminateWithError('BSC_DIMCONFIG_FAILED', 'Corrections');
262: RAISE;
263:
264: End ;

Line 261: bsc_mo_helper_pkg.terminateWithError('BSC_DIMCONFIG_FAILED', 'Corrections');

257: END LOOP;
258:
259: EXCEPTION WHEN OTHERS THEN
260: bsc_mo_helper_pkg.writeTmp('Exception in Corrections : '||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);
261: bsc_mo_helper_pkg.terminateWithError('BSC_DIMCONFIG_FAILED', 'Corrections');
262: RAISE;
263:
264: End ;
265:

Line 295: bsc_mo_helper_pkg.writeTmp('Inside ReCreateMaterializedViewsIndic', FND_LOG.LEVEL_PROCEDURE);

291: l_temp NUMBER;
292: BEGIN
293: --Populate mapping tables for the indicator before create materialized views
294: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
295: bsc_mo_helper_pkg.writeTmp('Inside ReCreateMaterializedViewsIndic', FND_LOG.LEVEL_PROCEDURE);
296: END IF;
297: --l_stmt := 'begin BSC_INTEGRATION_APIS.Populate_Mapping_Tables('|| Indic ||'); end;';
298: --EXECUTE IMMEDIATE l_stmt;
299: -- Obsoleted

Line 308: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gPeriodicities, periodicity_id);

304: LOOP
305: FETCH c1 INTO table_name, periodicity_id;
306: EXIT WHEN c1%NOTFOUND;
307: --Create the materialized view
308: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gPeriodicities, periodicity_id);
309:
310: cal_id := BSC_METADATA_OPTIMIZER_PKG.gPeriodicities(l_temp).CalendarID;
311: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gCalendars, cal_id);
312: num_years := BSC_METADATA_OPTIMIZER_PKG.gCalendars(l_temp).NumOfYears;

Line 311: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gCalendars, cal_id);

307: --Create the materialized view
308: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gPeriodicities, periodicity_id);
309:
310: cal_id := BSC_METADATA_OPTIMIZER_PKG.gPeriodicities(l_temp).CalendarID;
311: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gCalendars, cal_id);
312: num_years := BSC_METADATA_OPTIMIZER_PKG.gCalendars(l_temp).NumOfYears;
313: num_prev_years := BSC_METADATA_OPTIMIZER_PKG.gCalendars(l_temp).PreviousYears;
314: fiscal_year := BSC_METADATA_OPTIMIZER_PKG.gCalendars(l_temp).CurrFiscalYear;
315:

Line 324: BSC_MO_HELPER_PKG.do_ddl(l_stmt, ad_ddl.create_view, uv_name);

320: --We have to recreate the union view because the materializaed
321: --view is invalid until loader refresh it
322: uv_name := table_name || BSC_METADATA_OPTIMIZER_PKG.EDW_UNION_VIEW_EXT;
323: l_stmt := 'CREATE OR REPLACE VIEW '|| uv_name ||' AS SELECT * FROM '|| table_name;
324: BSC_MO_HELPER_PKG.do_ddl(l_stmt, ad_ddl.create_view, uv_name);
325:
326: END Loop;
327: CLOSE C1;
328: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN

Line 329: bsc_mo_helper_pkg.writeTmp('Completed ReCreateMaterializedViewsIndic', FND_LOG.LEVEL_PROCEDURE);

325:
326: END Loop;
327: CLOSE C1;
328: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
329: bsc_mo_helper_pkg.writeTmp('Completed ReCreateMaterializedViewsIndic', FND_LOG.LEVEL_PROCEDURE);
330: END IF;
331:
332: EXCEPTION WHEN OTHERS THEN
333: bsc_mo_helper_pkg.writeTmp('Exception in ReCreateMaterializedViewsIndic : '||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);

Line 333: bsc_mo_helper_pkg.writeTmp('Exception in ReCreateMaterializedViewsIndic : '||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);

329: bsc_mo_helper_pkg.writeTmp('Completed ReCreateMaterializedViewsIndic', FND_LOG.LEVEL_PROCEDURE);
330: END IF;
331:
332: EXCEPTION WHEN OTHERS THEN
333: bsc_mo_helper_pkg.writeTmp('Exception in ReCreateMaterializedViewsIndic : '||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);
334: bsc_mo_helper_pkg.terminateWithMsg('Exception in ReCreateMaterializedViewsIndic : '||sqlerrm);
335: raise;
336: End ;
337:

Line 334: bsc_mo_helper_pkg.terminateWithMsg('Exception in ReCreateMaterializedViewsIndic : '||sqlerrm);

330: END IF;
331:
332: EXCEPTION WHEN OTHERS THEN
333: bsc_mo_helper_pkg.writeTmp('Exception in ReCreateMaterializedViewsIndic : '||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);
334: bsc_mo_helper_pkg.terminateWithMsg('Exception in ReCreateMaterializedViewsIndic : '||sqlerrm);
335: raise;
336: End ;
337:
338:

Line 371: bsc_mo_helper_pkg.writeTmp('Exception in CalcProjectionTable:'||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);

367: close c1;
368: return l_ret;
369:
370: EXCEPTION WHEN OTHERS THEN
371: bsc_mo_helper_pkg.writeTmp('Exception in CalcProjectionTable:'||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);
372: raise;
373: End;
374:
375:

Line 408: If BSC_MO_HELPER_PKG.findIndexVARCHAR2(arrIndicTables, TableName)>-1 Then

404: Else
405: If (l_table_type) = 0 Then
406: l_return := 1; -- base table
407: Else
408: If BSC_MO_HELPER_PKG.findIndexVARCHAR2(arrIndicTables, TableName)>-1 Then
409: If BSC_MO_HELPER_PKG.findIndexVARCHAR2(arrIndicTables, l_table_name)=-1 Then
410: l_return := 3; -- Indicator table (lowest level)
411: Else
412: l_return := 4; -- Indicator table (summary level)

Line 409: If BSC_MO_HELPER_PKG.findIndexVARCHAR2(arrIndicTables, l_table_name)=-1 Then

405: If (l_table_type) = 0 Then
406: l_return := 1; -- base table
407: Else
408: If BSC_MO_HELPER_PKG.findIndexVARCHAR2(arrIndicTables, TableName)>-1 Then
409: If BSC_MO_HELPER_PKG.findIndexVARCHAR2(arrIndicTables, l_table_name)=-1 Then
410: l_return := 3; -- Indicator table (lowest level)
411: Else
412: l_return := 4; -- Indicator table (summary level)
413: End If;

Line 423: bsc_mo_helper_pkg.writeTmp('Exception in GetIndicTableType:'||sqlerrm, FND_LOG.LEVEL_EXCEPTION, true);

419: CLOSE C1;
420: return l_return;
421:
422: EXCEPTION WHEN OTHERS THEN
423: bsc_mo_helper_pkg.writeTmp('Exception in GetIndicTableType:'||sqlerrm, FND_LOG.LEVEL_EXCEPTION, true);
424: raise;
425: End ;
426:
427:

Line 451: BSC_MO_HELPER_PKG.writeTmp('Inside InsertOriginTables, arrTables.count = '||arrTables.count);

447: strWhereInTables VARCHAR2(1000);
448: l_varchar2_list dbms_sql.varchar2_table;
449: BEGIN
450: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
451: BSC_MO_HELPER_PKG.writeTmp('Inside InsertOriginTables, arrTables.count = '||arrTables.count);
452: END IF;
453:
454: IF (arrTables.count = 0) THEN
455: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN

Line 456: BSC_MO_HELPER_PKG.writeTmp('Completed InsertOriginTables, count = 0');

452: END IF;
453:
454: IF (arrTables.count = 0) THEN
455: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
456: BSC_MO_HELPER_PKG.writeTmp('Completed InsertOriginTables, count = 0');
457: END IF;
458: return;
459: END IF;
460:

Line 461: strWhereInTables := BSC_MO_HELPER_PKG.Get_New_Big_In_Cond_Varchar2(1, 'TABLE_NAME');

457: END IF;
458: return;
459: END IF;
460:
461: strWhereInTables := BSC_MO_HELPER_PKG.Get_New_Big_In_Cond_Varchar2(1, 'TABLE_NAME');
462: l_index := arrTables.first;
463:
464: LOOP
465: EXIT WHEN arrTables.count = 0;

Line 466: If Not BSC_MO_HELPER_PKG.searchStringExists(arrOriginTables, arrOriginTables.count, arrTables(l_index)) Then

462: l_index := arrTables.first;
463:
464: LOOP
465: EXIT WHEN arrTables.count = 0;
466: If Not BSC_MO_HELPER_PKG.searchStringExists(arrOriginTables, arrOriginTables.count, arrTables(l_index)) Then
467: arrOriginTables(arrOriginTables.count) := arrTables(l_index);
468: l_varchar2_list(l_varchar2_list.count+1) := arrTables(l_index);
469: --BSC_MO_HELPER_PKG.Add_Value_Big_In_Cond_Varchar2 (1, arrTables(l_index));
470: End If;

Line 469: --BSC_MO_HELPER_PKG.Add_Value_Big_In_Cond_Varchar2 (1, arrTables(l_index));

465: EXIT WHEN arrTables.count = 0;
466: If Not BSC_MO_HELPER_PKG.searchStringExists(arrOriginTables, arrOriginTables.count, arrTables(l_index)) Then
467: arrOriginTables(arrOriginTables.count) := arrTables(l_index);
468: l_varchar2_list(l_varchar2_list.count+1) := arrTables(l_index);
469: --BSC_MO_HELPER_PKG.Add_Value_Big_In_Cond_Varchar2 (1, arrTables(l_index));
470: End If;
471: EXIT WHEN l_index = arrTables.last;
472: l_index := arrTables.next(l_index);
473: END LOOP;

Line 474: bsc_mo_helper_pkg.add_value_bulk(1, l_varchar2_list);

470: End If;
471: EXIT WHEN l_index = arrTables.last;
472: l_index := arrTables.next(l_index);
473: END LOOP;
474: bsc_mo_helper_pkg.add_value_bulk(1, l_varchar2_list);
475: l_varchar2_list.delete;
476: l_stmt := 'SELECT SOURCE_TABLE_NAME FROM BSC_DB_TABLES_RELS WHERE '|| strWhereInTables;
477: OPEN CV for l_stmt;
478: LOOP

Line 487: BSC_MO_HELPER_PKG.writeTmp('Completed InsertOriginTables, arrOriginTables.count = '||arrOriginTables.count);

483: Close CV;
484:
485: InsertOriginTables (arrTablesAux, arrOriginTables);
486: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
487: BSC_MO_HELPER_PKG.writeTmp('Completed InsertOriginTables, arrOriginTables.count = '||arrOriginTables.count);
488: END IF;
489:
490:
491: EXCEPTION WHEN OTHERS THEN

Line 492: bsc_mo_helper_pkg.writeTmp('Exception in InsertOriginTables:'||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);

488: END IF;
489:
490:
491: EXCEPTION WHEN OTHERS THEN
492: bsc_mo_helper_pkg.writeTmp('Exception in InsertOriginTables:'||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);
493: raise;
494: End;
495:
496:

Line 530: bsc_mo_helper_pkg.writeTmp('Inside InitarrTablesIndic');

526:
527: l_table VARCHAR2(100);
528: BEGIN
529: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
530: bsc_mo_helper_pkg.writeTmp('Inside InitarrTablesIndic');
531: END IF;
532: numTables := 0;
533: numIndicTables := 0;
534:

Line 558: bsc_mo_helper_pkg.writeTmp('Completed InitarrTablesIndic');

554: numIndicTables := numIndicTables + 1;
555: END Loop;
556: InsertOriginTables( arrIndicTables, arrTables);
557: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
558: bsc_mo_helper_pkg.writeTmp('Completed InitarrTablesIndic');
559: END IF;
560:
561: EXCEPTION WHEN OTHERS THEN
562: bsc_mo_helper_pkg.writeTmp('Exception in InitarrTablesIndic:'||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);

Line 562: bsc_mo_helper_pkg.writeTmp('Exception in InitarrTablesIndic:'||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);

558: bsc_mo_helper_pkg.writeTmp('Completed InitarrTablesIndic');
559: END IF;
560:
561: EXCEPTION WHEN OTHERS THEN
562: bsc_mo_helper_pkg.writeTmp('Exception in InitarrTablesIndic:'||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);
563: raise;
564: End ;
565:
566:

Line 595: bsc_mo_helper_pkg.writeTmp('Exception in getLevelIndex:'||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);

591: FETCH c1 INTO l_ret;
592: CLOSE c1;
593: return l_ret;
594: EXCEPTION WHEN OTHERS THEN
595: bsc_mo_helper_pkg.writeTmp('Exception in getLevelIndex:'||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);
596: raise;
597: End;
598:
599:

Line 644: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gPeriodicities, Tabla.Periodicity);

640: Else
641: --BSC-MV Note: In this architecture we only calculate projection
642: --on tables receiving directly targets (targets at different level)
643: If Not BSC_METADATA_OPTIMIZER_PKG.G_BSC_MV Then
644: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gPeriodicities, Tabla.Periodicity);
645: If (BSC_METADATA_OPTIMIZER_PKG.gPeriodicities(l_temp).Yearly_Flag = 1) And
646: (Tabla.Periodicity <> PeriodicityOrigin) Then
647: p_projection := 1;
648: End If;

Line 654: bsc_mo_helper_pkg.writeTmp('Checking Soft Relations');

650: End If;
651: End If;
652: --If any of the source tables (soft relations) is a target table then we need to proyect this table.
653: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
654: bsc_mo_helper_pkg.writeTmp('Checking Soft Relations');
655: END IF;
656: IF (Tabla.originTable1 IS NOT NULL) THEN
657: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
658: bsc_mo_helper_pkg.writeTmp('Tabla.originTable1 is not null');

Line 658: bsc_mo_helper_pkg.writeTmp('Tabla.originTable1 is not null');

654: bsc_mo_helper_pkg.writeTmp('Checking Soft Relations');
655: END IF;
656: IF (Tabla.originTable1 IS NOT NULL) THEN
657: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
658: bsc_mo_helper_pkg.writeTmp('Tabla.originTable1 is not null');
659: END IF;
660: Tabla_originTable1 := BSC_MO_HELPER_PKG.getDecomposedString(Tabla.originTable1, ',');
661: l_index2 := Tabla_originTable1.first;
662: LOOP

Line 660: Tabla_originTable1 := BSC_MO_HELPER_PKG.getDecomposedString(Tabla.originTable1, ',');

656: IF (Tabla.originTable1 IS NOT NULL) THEN
657: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
658: bsc_mo_helper_pkg.writeTmp('Tabla.originTable1 is not null');
659: END IF;
660: Tabla_originTable1 := BSC_MO_HELPER_PKG.getDecomposedString(Tabla.originTable1, ',');
661: l_index2 := Tabla_originTable1.first;
662: LOOP
663: l_table_origin := Tabla_originTable1(l_index2);
664: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gTables, l_table_origin);

Line 664: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gTables, l_table_origin);

660: Tabla_originTable1 := BSC_MO_HELPER_PKG.getDecomposedString(Tabla.originTable1, ',');
661: l_index2 := Tabla_originTable1.first;
662: LOOP
663: l_table_origin := Tabla_originTable1(l_index2);
664: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gTables, l_table_origin);
665: If BSC_METADATA_OPTIMIZER_PKG.gTables(l_temp).IsTargetTable Then
666: p_projection := 1;
667: Exit;
668: End If;

Line 676: bsc_mo_helper_pkg.writeTmp('Exception in get_projection_and_gen_type:'||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);

672: END IF;
673: End If;--If Tabla.IsTargetTable Then
674: End If;--Tabla.Type = 0 Then
675: EXCEPTION WHEN OTHERS THEN
676: bsc_mo_helper_pkg.writeTmp('Exception in get_projection_and_gen_type:'||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);
677: raise;
678:
679: END;
680:

Line 708: l_dummy := BSC_MO_HELPER_PKG.Get_New_Big_In_Cond_Varchar2(10, 'SOURCE_TABLE_NAME');

704: begin
705: IF (p_del_s_tables.count=0) then
706: return;
707: END IF;
708: l_dummy := BSC_MO_HELPER_PKG.Get_New_Big_In_Cond_Varchar2(10, 'SOURCE_TABLE_NAME');
709: bsc_mo_helper_pkg.add_value_bulk(10, p_del_s_tables);
710: for i in MissingSTables loop
711: p_del_tables(p_del_tables.count+1) := i.table_name;
712: end loop;

Line 709: bsc_mo_helper_pkg.add_value_bulk(10, p_del_s_tables);

705: IF (p_del_s_tables.count=0) then
706: return;
707: END IF;
708: l_dummy := BSC_MO_HELPER_PKG.Get_New_Big_In_Cond_Varchar2(10, 'SOURCE_TABLE_NAME');
709: bsc_mo_helper_pkg.add_value_bulk(10, p_del_s_tables);
710: for i in MissingSTables loop
711: p_del_tables(p_del_tables.count+1) := i.table_name;
712: end loop;
713: return;

Line 805: BSC_MO_HELPER_PKG.writeTmp('Inside Loader Configuration ');

801: return;
802: END IF;
803: --
804: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
805: BSC_MO_HELPER_PKG.writeTmp('Inside Loader Configuration ');
806: END IF;
807: l_index1 := BSC_METADATA_OPTIMIZER_PKG.gTables.first;
808: -- Added 08/23/2005 for performance bug 4559323
809: --

Line 854: Tabla_originTable := BSC_MO_HELPER_PKG.getDecomposedString(Tabla.originTable, ',');

850: Tabla_keyName := Tabla.keys;
851: Tabla_data.delete;
852: Tabla_Data := Tabla.Data;
853: Tabla_originTable.delete;
854: Tabla_originTable := BSC_MO_HELPER_PKG.getDecomposedString(Tabla.originTable, ',');
855: Tabla_originTable1.delete;
856: Tabla_originTable1 := BSC_MO_HELPER_PKG.getDecomposedString(Tabla.originTable1, ',');
857: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
858: BSC_MO_HELPER_PKG.writeTmp(' ');

Line 856: Tabla_originTable1 := BSC_MO_HELPER_PKG.getDecomposedString(Tabla.originTable1, ',');

852: Tabla_Data := Tabla.Data;
853: Tabla_originTable.delete;
854: Tabla_originTable := BSC_MO_HELPER_PKG.getDecomposedString(Tabla.originTable, ',');
855: Tabla_originTable1.delete;
856: Tabla_originTable1 := BSC_MO_HELPER_PKG.getDecomposedString(Tabla.originTable1, ',');
857: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
858: BSC_MO_HELPER_PKG.writeTmp(' ');
859: BSC_MO_HELPER_PKG.writeTmp(' ');
860: BSC_MO_HELPER_PKG.writeTmp('Processing gTables('||l_index1||') '||bsc_mo_helper_pkg.get_time);

Line 858: BSC_MO_HELPER_PKG.writeTmp(' ');

854: Tabla_originTable := BSC_MO_HELPER_PKG.getDecomposedString(Tabla.originTable, ',');
855: Tabla_originTable1.delete;
856: Tabla_originTable1 := BSC_MO_HELPER_PKG.getDecomposedString(Tabla.originTable1, ',');
857: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
858: BSC_MO_HELPER_PKG.writeTmp(' ');
859: BSC_MO_HELPER_PKG.writeTmp(' ');
860: BSC_MO_HELPER_PKG.writeTmp('Processing gTables('||l_index1||') '||bsc_mo_helper_pkg.get_time);
861: BSC_MO_HELPER_PKG.write_this(Tabla);
862: END IF;

Line 859: BSC_MO_HELPER_PKG.writeTmp(' ');

855: Tabla_originTable1.delete;
856: Tabla_originTable1 := BSC_MO_HELPER_PKG.getDecomposedString(Tabla.originTable1, ',');
857: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
858: BSC_MO_HELPER_PKG.writeTmp(' ');
859: BSC_MO_HELPER_PKG.writeTmp(' ');
860: BSC_MO_HELPER_PKG.writeTmp('Processing gTables('||l_index1||') '||bsc_mo_helper_pkg.get_time);
861: BSC_MO_HELPER_PKG.write_this(Tabla);
862: END IF;
863: bsc_mo_helper_pkg.writeTmp('Going to Delete Metadata tables for '||UPPER(Tabla.Name), FND_LOG.LEVEL_STATEMENT, false);

Line 860: BSC_MO_HELPER_PKG.writeTmp('Processing gTables('||l_index1||') '||bsc_mo_helper_pkg.get_time);

856: Tabla_originTable1 := BSC_MO_HELPER_PKG.getDecomposedString(Tabla.originTable1, ',');
857: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
858: BSC_MO_HELPER_PKG.writeTmp(' ');
859: BSC_MO_HELPER_PKG.writeTmp(' ');
860: BSC_MO_HELPER_PKG.writeTmp('Processing gTables('||l_index1||') '||bsc_mo_helper_pkg.get_time);
861: BSC_MO_HELPER_PKG.write_this(Tabla);
862: END IF;
863: bsc_mo_helper_pkg.writeTmp('Going to Delete Metadata tables for '||UPPER(Tabla.Name), FND_LOG.LEVEL_STATEMENT, false);
864: --BSC_DB_TABLES_RELS

Line 861: BSC_MO_HELPER_PKG.write_this(Tabla);

857: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
858: BSC_MO_HELPER_PKG.writeTmp(' ');
859: BSC_MO_HELPER_PKG.writeTmp(' ');
860: BSC_MO_HELPER_PKG.writeTmp('Processing gTables('||l_index1||') '||bsc_mo_helper_pkg.get_time);
861: BSC_MO_HELPER_PKG.write_this(Tabla);
862: END IF;
863: bsc_mo_helper_pkg.writeTmp('Going to Delete Metadata tables for '||UPPER(Tabla.Name), FND_LOG.LEVEL_STATEMENT, false);
864: --BSC_DB_TABLES_RELS
865: If Tabla.Type = 1 Then

Line 863: bsc_mo_helper_pkg.writeTmp('Going to Delete Metadata tables for '||UPPER(Tabla.Name), FND_LOG.LEVEL_STATEMENT, false);

859: BSC_MO_HELPER_PKG.writeTmp(' ');
860: BSC_MO_HELPER_PKG.writeTmp('Processing gTables('||l_index1||') '||bsc_mo_helper_pkg.get_time);
861: BSC_MO_HELPER_PKG.write_this(Tabla);
862: END IF;
863: bsc_mo_helper_pkg.writeTmp('Going to Delete Metadata tables for '||UPPER(Tabla.Name), FND_LOG.LEVEL_STATEMENT, false);
864: --BSC_DB_TABLES_RELS
865: If Tabla.Type = 1 Then
866: -- Changed to bulk deletes/inserts for better performance - bug 4559323
867: PeriodicityOrigin := 0;

Line 873: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gTables, l_table_origin);

869: IF (Tabla_originTable.count >0 ) THEN
870: l_index2 := Tabla_originTable.first;
871: LOOP
872: l_table_origin := Tabla_originTable(l_index2);
873: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gTables, l_table_origin);
874: IF (l_temp = -1 AND BSC_METADATA_OPTIMIZER_PKG.g_Sum_Level_Change <> 0) THEN
875: PeriodicityOrigin := Tabla.periodicity;
876: ELSE
877: PeriodicityOrigin := BSC_METADATA_OPTIMIZER_PKG.gTables(l_temp).Periodicity;

Line 881: BSC_MO_HELPER_PKG.writeTmp('INSERT DB_TABLES_RELS1:'||Tabla.Name||', '||l_table_origin||', 0');

877: PeriodicityOrigin := BSC_METADATA_OPTIMIZER_PKG.gTables(l_temp).Periodicity;
878: END IF;
879: OriTableName := l_table_origin;
880: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
881: BSC_MO_HELPER_PKG.writeTmp('INSERT DB_TABLES_RELS1:'||Tabla.Name||', '||l_table_origin||', 0');
882: END IF;
883: l_rels_record.table_name := upper(Tabla.Name);
884: l_rels_record.source_table_name := upper(l_table_origin);
885: l_rels_record.relation_type := 0;

Line 893: bsc_mo_helper_pkg.writeTmp('Checking Soft Relations1');

889: END LOOP;
890: END IF;
891: --Soft relations
892: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
893: bsc_mo_helper_pkg.writeTmp('Checking Soft Relations1');
894: bsc_mo_helper_pkg.writeTmp('Tabla_originTable1 = '||Tabla.originTable1||', Tabla_originTable1.count = '||Tabla_originTable1.count);
895: END IF;
896: IF (Tabla_originTable1.count > 0 ) THEN
897: l_index2 := Tabla_originTable1.first;

Line 894: bsc_mo_helper_pkg.writeTmp('Tabla_originTable1 = '||Tabla.originTable1||', Tabla_originTable1.count = '||Tabla_originTable1.count);

890: END IF;
891: --Soft relations
892: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
893: bsc_mo_helper_pkg.writeTmp('Checking Soft Relations1');
894: bsc_mo_helper_pkg.writeTmp('Tabla_originTable1 = '||Tabla.originTable1||', Tabla_originTable1.count = '||Tabla_originTable1.count);
895: END IF;
896: IF (Tabla_originTable1.count > 0 ) THEN
897: l_index2 := Tabla_originTable1.first;
898: LOOP

Line 901: BSC_MO_HELPER_PKG.writeTmp('INSERT DB_TABLES_RELS2:'||Tabla.Name||','||l_table_origin||',1');

897: l_index2 := Tabla_originTable1.first;
898: LOOP
899: l_table_origin := Tabla_originTable1(l_index2);
900: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
901: BSC_MO_HELPER_PKG.writeTmp('INSERT DB_TABLES_RELS2:'||Tabla.Name||','||l_table_origin||',1');
902: END IF;
903: l_rels_record.table_name := upper(Tabla.Name);
904: l_rels_record.source_table_name := upper(l_table_origin);
905: l_rels_record.relation_type := 1;

Line 912: bsc_mo_helper_pkg.writeTmp('Done checking Soft Relations1');

908: l_index2 := Tabla_originTable1.next(l_index2);
909: END LOOP;
910: END IF;
911: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
912: bsc_mo_helper_pkg.writeTmp('Done checking Soft Relations1');
913: END IF;
914: End If; -- IF TABLA.type = 1
915:
916: --BSC_DB_TABLES

Line 920: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gPeriodicities, Tabla.Periodicity);

916: --BSC_DB_TABLES
917: get_projection_and_gen_type(Tabla, PeriodicityOrigin, projection, l_generation_type);
918:
919: --EDW Note: Each calendar has his own fiscal year, and range of years
920: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gPeriodicities, Tabla.Periodicity);
921: Calendar_id := BSC_METADATA_OPTIMIZER_PKG.gPeriodicities(l_temp).CalendarId;
922: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gCalendars, calendar_id);
923: num_years := BSC_METADATA_OPTIMIZER_PKG.gCalendars(l_temp).NumOfYears;
924: num_prev_years := BSC_METADATA_OPTIMIZER_PKG.gCalendars(l_temp).PreviousYears;

Line 922: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gCalendars, calendar_id);

918:
919: --EDW Note: Each calendar has his own fiscal year, and range of years
920: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gPeriodicities, Tabla.Periodicity);
921: Calendar_id := BSC_METADATA_OPTIMIZER_PKG.gPeriodicities(l_temp).CalendarId;
922: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gCalendars, calendar_id);
923: num_years := BSC_METADATA_OPTIMIZER_PKG.gCalendars(l_temp).NumOfYears;
924: num_prev_years := BSC_METADATA_OPTIMIZER_PKG.gCalendars(l_temp).PreviousYears;
925: fiscal_year := BSC_METADATA_OPTIMIZER_PKG.gCalendars(l_temp).CurrFiscalYear;
926: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gPeriodicities, Tabla.Periodicity);

Line 926: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gPeriodicities, Tabla.Periodicity);

922: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gCalendars, calendar_id);
923: num_years := BSC_METADATA_OPTIMIZER_PKG.gCalendars(l_temp).NumOfYears;
924: num_prev_years := BSC_METADATA_OPTIMIZER_PKG.gCalendars(l_temp).PreviousYears;
925: fiscal_year := BSC_METADATA_OPTIMIZER_PKG.gCalendars(l_temp).CurrFiscalYear;
926: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gPeriodicities, Tabla.Periodicity);
927: If BSC_METADATA_OPTIMIZER_PKG.gPeriodicities(l_temp).Yearly_Flag = 1 Then
928: --Annual periodicity
929: Periodo_Act := fiscal_year;
930: Else

Line 957: BSC_MO_HELPER_PKG.writeTmp('INSERT DB_TABLES:'||

953: Else
954: Target_Flag := 0;
955: End If;
956: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
957: BSC_MO_HELPER_PKG.writeTmp('INSERT DB_TABLES:'||
958: Tabla.Name||', type='|| Tabla.Type||', periodicity='||Tabla.Periodicity||', gen_type='||
959: l_generation_type ||', projection = '|| projection||', num_years'|| num_years||', num_prev_years= '||
960: num_prev_years||','||Periodo_Act||','|| SubPeriodo_Act||','|| EDW_Flag||',' ||Target_Flag||' '||bsc_mo_helper_pkg.get_time);
961: END IF;

Line 960: num_prev_years||','||Periodo_Act||','|| SubPeriodo_Act||','|| EDW_Flag||',' ||Target_Flag||' '||bsc_mo_helper_pkg.get_time);

956: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
957: BSC_MO_HELPER_PKG.writeTmp('INSERT DB_TABLES:'||
958: Tabla.Name||', type='|| Tabla.Type||', periodicity='||Tabla.Periodicity||', gen_type='||
959: l_generation_type ||', projection = '|| projection||', num_years'|| num_years||', num_prev_years= '||
960: num_prev_years||','||Periodo_Act||','|| SubPeriodo_Act||','|| EDW_Flag||',' ||Target_Flag||' '||bsc_mo_helper_pkg.get_time);
961: END IF;
962: l_db_tables_record.TABLE_NAME := upper(Tabla.Name);
963: l_db_tables_record.TABLE_TYPE := Tabla.Type;
964: l_db_tables_record.PERIODICITY_ID := Tabla.Periodicity;

Line 1006: BSC_MO_HELPER_PKG.writeTmp('INSERT DB_CALCULATIONS1:'||

1002: Else
1003: ZeroCodeOrigin := l_measure.aggFunction|| '('|| l_measure.fieldName || ')';
1004: End If;
1005: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
1006: BSC_MO_HELPER_PKG.writeTmp('INSERT DB_CALCULATIONS1:'||
1007: Tabla.name||','||arrZeroCodeKeys(i)||','||i||','|| l_measure.fieldName||','||ZeroCodeOrigin||' '||bsc_mo_helper_pkg.get_time);
1008: END IF;
1009: l_db_calculations_record.TABLE_NAME := upper(Tabla.name);
1010: l_db_calculations_record.CALCULATION_TYPE := 4;

Line 1007: Tabla.name||','||arrZeroCodeKeys(i)||','||i||','|| l_measure.fieldName||','||ZeroCodeOrigin||' '||bsc_mo_helper_pkg.get_time);

1003: ZeroCodeOrigin := l_measure.aggFunction|| '('|| l_measure.fieldName || ')';
1004: End If;
1005: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
1006: BSC_MO_HELPER_PKG.writeTmp('INSERT DB_CALCULATIONS1:'||
1007: Tabla.name||','||arrZeroCodeKeys(i)||','||i||','|| l_measure.fieldName||','||ZeroCodeOrigin||' '||bsc_mo_helper_pkg.get_time);
1008: END IF;
1009: l_db_calculations_record.TABLE_NAME := upper(Tabla.name);
1010: l_db_calculations_record.CALCULATION_TYPE := 4;
1011: l_db_calculations_record.PARAMETER1 := arrZeroCodeKeys(i);

Line 1027: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gTables, l_table_origin);

1023: IF (Tabla_originTable1.count>0) THEN
1024: l_index2 := Tabla_originTable1.first;
1025: LOOP
1026: l_table_origin := Tabla_originTable1(l_index2);
1027: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gTables, l_table_origin);
1028: If BSC_METADATA_OPTIMIZER_PKG.gTables(l_temp).IsTargetTable Then
1029: IF ( Tabla_Data.count>0) THEN
1030: l_index3 := Tabla_Data.first;
1031: LOOP

Line 1034: BSC_MO_HELPER_PKG.writeTmp('INSERT DB_CALCULATIONS2:'||

1030: l_index3 := Tabla_Data.first;
1031: LOOP
1032: l_measure := Tabla_Data(l_index3);
1033: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
1034: BSC_MO_HELPER_PKG.writeTmp('INSERT DB_CALCULATIONS2:'||
1035: Tabla.Name||',5,'|| l_table_origin||','|| l_measure.fieldName);
1036: END IF;
1037: l_db_calculations_record.TABLE_NAME := upper(Tabla.name);
1038: l_db_calculations_record.CALCULATION_TYPE := 5;

Line 1062: BSC_MO_HELPER_PKG.writeTmp('INSERT DB_TABLES_COLS2: table_name='||Tabla.Name||

1058: l_index2 := Tabla_keyName.first;
1059: LOOP
1060: l_key := Tabla_keyName(l_index2);
1061: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
1062: BSC_MO_HELPER_PKG.writeTmp('INSERT DB_TABLES_COLS2: table_name='||Tabla.Name||
1063: ', column_type=P, column_name = '||l_key.keyName||', source_column='||l_key.Origin||' '||bsc_mo_helper_pkg.get_time);
1064: END IF;
1065: BEGIN
1066: l_db_tables_cols_record.TABLE_NAME := upper(Tabla.Name);

Line 1063: ', column_type=P, column_name = '||l_key.keyName||', source_column='||l_key.Origin||' '||bsc_mo_helper_pkg.get_time);

1059: LOOP
1060: l_key := Tabla_keyName(l_index2);
1061: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
1062: BSC_MO_HELPER_PKG.writeTmp('INSERT DB_TABLES_COLS2: table_name='||Tabla.Name||
1063: ', column_type=P, column_name = '||l_key.keyName||', source_column='||l_key.Origin||' '||bsc_mo_helper_pkg.get_time);
1064: END IF;
1065: BEGIN
1066: l_db_tables_cols_record.TABLE_NAME := upper(Tabla.Name);
1067: l_db_tables_cols_record.COLUMN_TYPE := 'P';

Line 1084: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gLov, l_measure.fieldName, l_measure.source);

1080: l_index2 := Tabla_Data.first;
1081: LOOP
1082: l_measure := Tabla_Data(l_index2);
1083: If projection = 1 Then
1084: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gLov, l_measure.fieldName, l_measure.source);
1085: l_prj_method := BSC_METADATA_OPTIMIZER_PKG.gLov(l_temp).prjMethod;
1086: Else
1087: l_prj_method := 0;
1088: End If;

Line 1090: BSC_MO_HELPER_PKG.writeTmp('INSERT DB_TABLES_COLS2: Table_name = '||Tabla.Name||', column_type = A, Column Name= '||

1086: Else
1087: l_prj_method := 0;
1088: End If;
1089: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
1090: BSC_MO_HELPER_PKG.writeTmp('INSERT DB_TABLES_COLS2: Table_name = '||Tabla.Name||', column_type = A, Column Name= '||
1091: l_measure.fieldName||', source='||l_measure.source||', projection='||l_prj_method||', origin = '||l_measure.Origin||' '||bsc_mo_helper_pkg.get_time );
1092: END IF;
1093: l_db_tables_cols_record.TABLE_NAME := upper(Tabla.Name);
1094: l_db_tables_cols_record.COLUMN_TYPE := 'A';

Line 1091: l_measure.fieldName||', source='||l_measure.source||', projection='||l_prj_method||', origin = '||l_measure.Origin||' '||bsc_mo_helper_pkg.get_time );

1087: l_prj_method := 0;
1088: End If;
1089: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
1090: BSC_MO_HELPER_PKG.writeTmp('INSERT DB_TABLES_COLS2: Table_name = '||Tabla.Name||', column_type = A, Column Name= '||
1091: l_measure.fieldName||', source='||l_measure.source||', projection='||l_prj_method||', origin = '||l_measure.Origin||' '||bsc_mo_helper_pkg.get_time );
1092: END IF;
1093: l_db_tables_cols_record.TABLE_NAME := upper(Tabla.Name);
1094: l_db_tables_cols_record.COLUMN_TYPE := 'A';
1095: l_db_tables_cols_record.COLUMN_NAME := l_measure.fieldName;

Line 1104: BSC_MO_HELPER_PKG.writeTmp('Data Cols insertion completed for Table='||Tabla.Name);

1100: EXIT WHEN l_index2 = Tabla_Data.last;
1101: l_index2 := Tabla_Data.next(l_index2);
1102: END LOOP;
1103: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
1104: BSC_MO_HELPER_PKG.writeTmp('Data Cols insertion completed for Table='||Tabla.Name);
1105: END IF;
1106: END IF;
1107: --Special cases: This is a table of a Balance or PnL indicator
1108: --BSC-MV Note: Profit calculation will be done in the base tables at sub-account level

Line 1113: BSC_MO_HELPER_PKG.writeTmp('Indicator<>0');

1109: If Not BSC_METADATA_OPTIMIZER_PKG.G_BSC_MV Then
1110: --current architecture
1111: If Tabla.Indicator <> 0 Then
1112: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
1113: BSC_MO_HELPER_PKG.writeTmp('Indicator<>0');
1114: END IF;
1115: If BSC_MO_INDICATOR_PKG.IsIndicatorPnL(Tabla.Indicator, true ) Then
1116: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
1117: BSC_MO_HELPER_PKG.writeTmp('Indicator is PnL');

Line 1117: BSC_MO_HELPER_PKG.writeTmp('Indicator is PnL');

1113: BSC_MO_HELPER_PKG.writeTmp('Indicator<>0');
1114: END IF;
1115: If BSC_MO_INDICATOR_PKG.IsIndicatorPnL(Tabla.Indicator, true ) Then
1116: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
1117: BSC_MO_HELPER_PKG.writeTmp('Indicator is PnL');
1118: END IF;
1119: --This is a table of a PnL indicator
1120: IF (tabla_keyName.count > 0 ) THEN
1121: Dril1 := Tabla_keyName(Tabla_keyName.first).keyName;

Line 1129: BSC_MO_HELPER_PKG.writeTmp('INSERT DB_CALCULATIONS3:'||Tabla.Name||',1,'|| Dril1||' '||bsc_mo_helper_pkg.get_time);

1125: --We need to calculate the profit
1126: --BSC_DB_CALCULATIONS
1127: l_db_calc_1_delete(l_db_calc_1_delete.count+1) := UPPER(Tabla.Name);
1128: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
1129: BSC_MO_HELPER_PKG.writeTmp('INSERT DB_CALCULATIONS3:'||Tabla.Name||',1,'|| Dril1||' '||bsc_mo_helper_pkg.get_time);
1130: END IF;
1131: l_db_calculations_record.TABLE_NAME := upper(Tabla.name);
1132: l_db_calculations_record.CALCULATION_TYPE := 1;
1133: l_db_calculations_record.PARAMETER1 := Dril1;

Line 1145: BSC_MO_HELPER_PKG.writeTmp('Production table altered', FND_LOG.LEVEL_STATEMENT, false);

1141: END IF;
1142: End If;
1143: <>
1144: IF ( Tabla.isProductionTable AND Tabla.isProductionTableAltered) THEN
1145: BSC_MO_HELPER_PKG.writeTmp('Production table altered', FND_LOG.LEVEL_STATEMENT, false);
1146: BSC_MO_HELPER_PKG.write_to_stack('Production table altered');
1147: -- table has been altered, so insert into bsc_db_tables_cols
1148: If Tabla.Type = 1 Then
1149: BSC_MO_HELPER_PKG.write_to_stack('Table Type=1');

Line 1146: BSC_MO_HELPER_PKG.write_to_stack('Production table altered');

1142: End If;
1143: <>
1144: IF ( Tabla.isProductionTable AND Tabla.isProductionTableAltered) THEN
1145: BSC_MO_HELPER_PKG.writeTmp('Production table altered', FND_LOG.LEVEL_STATEMENT, false);
1146: BSC_MO_HELPER_PKG.write_to_stack('Production table altered');
1147: -- table has been altered, so insert into bsc_db_tables_cols
1148: If Tabla.Type = 1 Then
1149: BSC_MO_HELPER_PKG.write_to_stack('Table Type=1');
1150: PeriodicityOrigin := 0;

Line 1149: BSC_MO_HELPER_PKG.write_to_stack('Table Type=1');

1145: BSC_MO_HELPER_PKG.writeTmp('Production table altered', FND_LOG.LEVEL_STATEMENT, false);
1146: BSC_MO_HELPER_PKG.write_to_stack('Production table altered');
1147: -- table has been altered, so insert into bsc_db_tables_cols
1148: If Tabla.Type = 1 Then
1149: BSC_MO_HELPER_PKG.write_to_stack('Table Type=1');
1150: PeriodicityOrigin := 0;
1151: Tabla_originTable := BSC_MO_HELPER_PKG.getDecomposedString(Tabla.originTable, ',');
1152: BSC_MO_HELPER_PKG.write_to_stack('OriginTable='||Tabla.originTable);
1153: OriTableName := null;

Line 1151: Tabla_originTable := BSC_MO_HELPER_PKG.getDecomposedString(Tabla.originTable, ',');

1147: -- table has been altered, so insert into bsc_db_tables_cols
1148: If Tabla.Type = 1 Then
1149: BSC_MO_HELPER_PKG.write_to_stack('Table Type=1');
1150: PeriodicityOrigin := 0;
1151: Tabla_originTable := BSC_MO_HELPER_PKG.getDecomposedString(Tabla.originTable, ',');
1152: BSC_MO_HELPER_PKG.write_to_stack('OriginTable='||Tabla.originTable);
1153: OriTableName := null;
1154: IF (Tabla_originTable.count >0 ) THEN
1155: l_table_origin := Tabla_originTable(0);

Line 1152: BSC_MO_HELPER_PKG.write_to_stack('OriginTable='||Tabla.originTable);

1148: If Tabla.Type = 1 Then
1149: BSC_MO_HELPER_PKG.write_to_stack('Table Type=1');
1150: PeriodicityOrigin := 0;
1151: Tabla_originTable := BSC_MO_HELPER_PKG.getDecomposedString(Tabla.originTable, ',');
1152: BSC_MO_HELPER_PKG.write_to_stack('OriginTable='||Tabla.originTable);
1153: OriTableName := null;
1154: IF (Tabla_originTable.count >0 ) THEN
1155: l_table_origin := Tabla_originTable(0);
1156: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gTables, l_table_origin);

Line 1156: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gTables, l_table_origin);

1152: BSC_MO_HELPER_PKG.write_to_stack('OriginTable='||Tabla.originTable);
1153: OriTableName := null;
1154: IF (Tabla_originTable.count >0 ) THEN
1155: l_table_origin := Tabla_originTable(0);
1156: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gTables, l_table_origin);
1157: BSC_MO_HELPER_PKG.write_to_stack('l_temp='||l_temp);
1158: IF (l_temp = -1 OR BSC_METADATA_OPTIMIZER_PKG.g_Sum_Level_Change <> 0) THEN
1159: PeriodicityOrigin := Tabla.periodicity;
1160: ELSE

Line 1157: BSC_MO_HELPER_PKG.write_to_stack('l_temp='||l_temp);

1153: OriTableName := null;
1154: IF (Tabla_originTable.count >0 ) THEN
1155: l_table_origin := Tabla_originTable(0);
1156: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gTables, l_table_origin);
1157: BSC_MO_HELPER_PKG.write_to_stack('l_temp='||l_temp);
1158: IF (l_temp = -1 OR BSC_METADATA_OPTIMIZER_PKG.g_Sum_Level_Change <> 0) THEN
1159: PeriodicityOrigin := Tabla.periodicity;
1160: ELSE
1161: PeriodicityOrigin := BSC_METADATA_OPTIMIZER_PKG.gTables(l_temp).Periodicity;

Line 1163: BSC_MO_HELPER_PKG.write_to_stack('PeriodicityOrigin='||PeriodicityOrigin);

1159: PeriodicityOrigin := Tabla.periodicity;
1160: ELSE
1161: PeriodicityOrigin := BSC_METADATA_OPTIMIZER_PKG.gTables(l_temp).Periodicity;
1162: END IF;
1163: BSC_MO_HELPER_PKG.write_to_stack('PeriodicityOrigin='||PeriodicityOrigin);
1164: END IF;
1165: END IF;
1166: IF (Tabla.data.count>0) THEN
1167: BSC_MO_HELPER_PKG.write_to_stack('going to get_projection_and_gen_type');

Line 1167: BSC_MO_HELPER_PKG.write_to_stack('going to get_projection_and_gen_type');

1163: BSC_MO_HELPER_PKG.write_to_stack('PeriodicityOrigin='||PeriodicityOrigin);
1164: END IF;
1165: END IF;
1166: IF (Tabla.data.count>0) THEN
1167: BSC_MO_HELPER_PKG.write_to_stack('going to get_projection_and_gen_type');
1168: get_projection_and_gen_type(Tabla, PeriodicityOrigin, projection, l_generation_type);
1169: -- Get list of source tables from this table to the Input table
1170: Tabla_originTable := BSC_DBGEN_UTILS.get_source_table_names(Tabla.name);
1171: Tabla_originTable(Tabla_originTable.count) := Tabla.Name;

Line 1174: BSC_MO_HELPER_PKG.writeTmp('Considering '||Tabla.data(i).fieldName, FND_LOG.LEVEL_STATEMENT, false);

1170: Tabla_originTable := BSC_DBGEN_UTILS.get_source_table_names(Tabla.name);
1171: Tabla_originTable(Tabla_originTable.count) := Tabla.Name;
1172: FOR i IN Tabla.data.first..Tabla.data.last LOOP
1173: l_measure := Tabla.data(i);
1174: BSC_MO_HELPER_PKG.writeTmp('Considering '||Tabla.data(i).fieldName, FND_LOG.LEVEL_STATEMENT, false);
1175: BSC_MO_HELPER_PKG.write_this(Tabla.data(i));
1176: IF Tabla.data(i).changeType='NEW' THEN -- new column, insert into db_tables_cols
1177: If projection = 1 Then
1178: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gLov, l_measure.fieldName, l_measure.source);

Line 1175: BSC_MO_HELPER_PKG.write_this(Tabla.data(i));

1171: Tabla_originTable(Tabla_originTable.count) := Tabla.Name;
1172: FOR i IN Tabla.data.first..Tabla.data.last LOOP
1173: l_measure := Tabla.data(i);
1174: BSC_MO_HELPER_PKG.writeTmp('Considering '||Tabla.data(i).fieldName, FND_LOG.LEVEL_STATEMENT, false);
1175: BSC_MO_HELPER_PKG.write_this(Tabla.data(i));
1176: IF Tabla.data(i).changeType='NEW' THEN -- new column, insert into db_tables_cols
1177: If projection = 1 Then
1178: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gLov, l_measure.fieldName, l_measure.source);
1179: BSC_MO_HELPER_PKG.writeTmp('gLov, l_temp='||l_temp, FND_LOG.LEVEL_STATEMENT, false);

Line 1178: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gLov, l_measure.fieldName, l_measure.source);

1174: BSC_MO_HELPER_PKG.writeTmp('Considering '||Tabla.data(i).fieldName, FND_LOG.LEVEL_STATEMENT, false);
1175: BSC_MO_HELPER_PKG.write_this(Tabla.data(i));
1176: IF Tabla.data(i).changeType='NEW' THEN -- new column, insert into db_tables_cols
1177: If projection = 1 Then
1178: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gLov, l_measure.fieldName, l_measure.source);
1179: BSC_MO_HELPER_PKG.writeTmp('gLov, l_temp='||l_temp, FND_LOG.LEVEL_STATEMENT, false);
1180: l_prj_method := BSC_METADATA_OPTIMIZER_PKG.gLov(l_temp).prjMethod;
1181: Else
1182: l_prj_method := 0;

Line 1179: BSC_MO_HELPER_PKG.writeTmp('gLov, l_temp='||l_temp, FND_LOG.LEVEL_STATEMENT, false);

1175: BSC_MO_HELPER_PKG.write_this(Tabla.data(i));
1176: IF Tabla.data(i).changeType='NEW' THEN -- new column, insert into db_tables_cols
1177: If projection = 1 Then
1178: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gLov, l_measure.fieldName, l_measure.source);
1179: BSC_MO_HELPER_PKG.writeTmp('gLov, l_temp='||l_temp, FND_LOG.LEVEL_STATEMENT, false);
1180: l_prj_method := BSC_METADATA_OPTIMIZER_PKG.gLov(l_temp).prjMethod;
1181: Else
1182: l_prj_method := 0;
1183: End If;

Line 1184: BSC_MO_HELPER_PKG.writeTmp('l_prj_method='||l_prj_method, FND_LOG.LEVEL_STATEMENT, false);

1180: l_prj_method := BSC_METADATA_OPTIMIZER_PKG.gLov(l_temp).prjMethod;
1181: Else
1182: l_prj_method := 0;
1183: End If;
1184: BSC_MO_HELPER_PKG.writeTmp('l_prj_method='||l_prj_method, FND_LOG.LEVEL_STATEMENT, false);
1185: FOR j IN Tabla_originTable.first..Tabla_originTable.last LOOP
1186: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
1187: BSC_MO_HELPER_PKG.writeTmp('INSERT DB_TABLES_COLS5: Table_name = '||Tabla_originTable(j)||', column_type = A, Column Name= '||
1188: l_measure.fieldName||', source='||l_measure.source||', projection='||l_prj_method||', origin = '||l_measure.Origin );

Line 1187: BSC_MO_HELPER_PKG.writeTmp('INSERT DB_TABLES_COLS5: Table_name = '||Tabla_originTable(j)||', column_type = A, Column Name= '||

1183: End If;
1184: BSC_MO_HELPER_PKG.writeTmp('l_prj_method='||l_prj_method, FND_LOG.LEVEL_STATEMENT, false);
1185: FOR j IN Tabla_originTable.first..Tabla_originTable.last LOOP
1186: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
1187: BSC_MO_HELPER_PKG.writeTmp('INSERT DB_TABLES_COLS5: Table_name = '||Tabla_originTable(j)||', column_type = A, Column Name= '||
1188: l_measure.fieldName||', source='||l_measure.source||', projection='||l_prj_method||', origin = '||l_measure.Origin );
1189: END IF;
1190: l_db_cols_1_delete_table_name(l_db_cols_1_delete_table_name.count+1) := upper(Tabla_originTable(j));
1191: l_db_cols_1_delete_field_name(l_db_cols_1_delete_field_name.count+1) := l_measure.fieldName;

Line 1208: BSC_MO_HELPER_PKG.writeTmp('Checkpoint 11 '||bsc_mo_helper_pkg.get_time, FND_LOG.LEVEL_STATEMENT, false);

1204: END IF;
1205: EXIT WHEN l_index1 = BSC_METADATA_OPTIMIZER_PKG.gTables.last;
1206: l_index1 := BSC_METADATA_OPTIMIZER_PKG.gTables.next(l_index1);
1207: END LOOP;
1208: BSC_MO_HELPER_PKG.writeTmp('Checkpoint 11 '||bsc_mo_helper_pkg.get_time, FND_LOG.LEVEL_STATEMENT, false);
1209:
1210: --BULK DELETES
1211: FORALL i IN 1..l_db_calc_1_delete.count
1212: DELETE FROM BSC_DB_CALCULATIONS WHERE TABLE_NAME = l_db_calc_1_delete(i) AND CALCULATION_TYPE = 1;

Line 1225: bsc_mo_helper_pkg.writeTmp('Error ' || i || ' occurred during '||

1221: INSERT INTO BSC_DB_TABLES_RELS VALUES l_tab_rels(i);
1222: EXCEPTION
1223: WHEN others THEN
1224: FOR i IN 1.. SQL%BULK_EXCEPTIONS.COUNT LOOP
1225: bsc_mo_helper_pkg.writeTmp('Error ' || i || ' occurred during '||
1226: 'iteration ' || SQL%BULK_EXCEPTIONS(i).ERROR_INDEX, FND_LOG.LEVEL_EXCEPTION, true);
1227: bsc_mo_helper_pkg.writeTmp('Oracle error is ' ||
1228: SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE),FND_LOG.LEVEL_EXCEPTION, true);
1229: END LOOP;

Line 1227: bsc_mo_helper_pkg.writeTmp('Oracle error is ' ||

1223: WHEN others THEN
1224: FOR i IN 1.. SQL%BULK_EXCEPTIONS.COUNT LOOP
1225: bsc_mo_helper_pkg.writeTmp('Error ' || i || ' occurred during '||
1226: 'iteration ' || SQL%BULK_EXCEPTIONS(i).ERROR_INDEX, FND_LOG.LEVEL_EXCEPTION, true);
1227: bsc_mo_helper_pkg.writeTmp('Oracle error is ' ||
1228: SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE),FND_LOG.LEVEL_EXCEPTION, true);
1229: END LOOP;
1230: FOR i IN 1..l_tab_rels.count LOOP
1231: bsc_mo_helper_pkg.writeTmp('Table='||l_tab_rels(i).table_name||', Source='||l_tab_rels(i).source_table_name||', Type='||l_tab_rels(i).relation_type,FND_LOG.LEVEL_EXCEPTION, true);

Line 1231: bsc_mo_helper_pkg.writeTmp('Table='||l_tab_rels(i).table_name||', Source='||l_tab_rels(i).source_table_name||', Type='||l_tab_rels(i).relation_type,FND_LOG.LEVEL_EXCEPTION, true);

1227: bsc_mo_helper_pkg.writeTmp('Oracle error is ' ||
1228: SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE),FND_LOG.LEVEL_EXCEPTION, true);
1229: END LOOP;
1230: FOR i IN 1..l_tab_rels.count LOOP
1231: bsc_mo_helper_pkg.writeTmp('Table='||l_tab_rels(i).table_name||', Source='||l_tab_rels(i).source_table_name||', Type='||l_tab_rels(i).relation_type,FND_LOG.LEVEL_EXCEPTION, true);
1232: END LOOP;
1233: END;
1234:
1235: BEGIN

Line 1241: bsc_mo_helper_pkg.writeTmp('Insert calculations: Number of errors is ' || SQL%BULK_EXCEPTIONS.COUNT, FND_LOG.LEVEL_EXCEPTION, true);

1237: INSERT INTO BSC_DB_CALCULATIONS VALUES l_tab_db_calculations(i);
1238: EXCEPTION
1239: WHEN others THEN
1240:
1241: bsc_mo_helper_pkg.writeTmp('Insert calculations: Number of errors is ' || SQL%BULK_EXCEPTIONS.COUNT, FND_LOG.LEVEL_EXCEPTION, true);
1242: FOR i IN 1.. SQL%BULK_EXCEPTIONS.COUNT LOOP
1243: bsc_mo_helper_pkg.writeTmp('Error ' || i || ' occurred during '||
1244: 'iteration ' || SQL%BULK_EXCEPTIONS(i).ERROR_INDEX, FND_LOG.LEVEL_EXCEPTION, true);
1245: bsc_mo_helper_pkg.writeTmp('Oracle error is ' ||

Line 1243: bsc_mo_helper_pkg.writeTmp('Error ' || i || ' occurred during '||

1239: WHEN others THEN
1240:
1241: bsc_mo_helper_pkg.writeTmp('Insert calculations: Number of errors is ' || SQL%BULK_EXCEPTIONS.COUNT, FND_LOG.LEVEL_EXCEPTION, true);
1242: FOR i IN 1.. SQL%BULK_EXCEPTIONS.COUNT LOOP
1243: bsc_mo_helper_pkg.writeTmp('Error ' || i || ' occurred during '||
1244: 'iteration ' || SQL%BULK_EXCEPTIONS(i).ERROR_INDEX, FND_LOG.LEVEL_EXCEPTION, true);
1245: bsc_mo_helper_pkg.writeTmp('Oracle error is ' ||
1246: SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE),FND_LOG.LEVEL_EXCEPTION, true);
1247: END LOOP;

Line 1245: bsc_mo_helper_pkg.writeTmp('Oracle error is ' ||

1241: bsc_mo_helper_pkg.writeTmp('Insert calculations: Number of errors is ' || SQL%BULK_EXCEPTIONS.COUNT, FND_LOG.LEVEL_EXCEPTION, true);
1242: FOR i IN 1.. SQL%BULK_EXCEPTIONS.COUNT LOOP
1243: bsc_mo_helper_pkg.writeTmp('Error ' || i || ' occurred during '||
1244: 'iteration ' || SQL%BULK_EXCEPTIONS(i).ERROR_INDEX, FND_LOG.LEVEL_EXCEPTION, true);
1245: bsc_mo_helper_pkg.writeTmp('Oracle error is ' ||
1246: SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE),FND_LOG.LEVEL_EXCEPTION, true);
1247: END LOOP;
1248: END;
1249:

Line 1256: bsc_mo_helper_pkg.writeTmp('Insert tables: Number of errors is ' || SQL%BULK_EXCEPTIONS.COUNT, FND_LOG.LEVEL_EXCEPTION, true);

1252: INSERT INTO BSC_DB_TABLES VALUES l_tab_db_tables(i);
1253: EXCEPTION
1254: WHEN others THEN
1255:
1256: bsc_mo_helper_pkg.writeTmp('Insert tables: Number of errors is ' || SQL%BULK_EXCEPTIONS.COUNT, FND_LOG.LEVEL_EXCEPTION, true);
1257: FOR i IN 1.. SQL%BULK_EXCEPTIONS.COUNT LOOP
1258: bsc_mo_helper_pkg.writeTmp('Error ' || i || ' occurred during '||
1259: 'iteration ' || SQL%BULK_EXCEPTIONS(i).ERROR_INDEX, FND_LOG.LEVEL_EXCEPTION, true);
1260: bsc_mo_helper_pkg.writeTmp('Oracle error is ' ||

Line 1258: bsc_mo_helper_pkg.writeTmp('Error ' || i || ' occurred during '||

1254: WHEN others THEN
1255:
1256: bsc_mo_helper_pkg.writeTmp('Insert tables: Number of errors is ' || SQL%BULK_EXCEPTIONS.COUNT, FND_LOG.LEVEL_EXCEPTION, true);
1257: FOR i IN 1.. SQL%BULK_EXCEPTIONS.COUNT LOOP
1258: bsc_mo_helper_pkg.writeTmp('Error ' || i || ' occurred during '||
1259: 'iteration ' || SQL%BULK_EXCEPTIONS(i).ERROR_INDEX, FND_LOG.LEVEL_EXCEPTION, true);
1260: bsc_mo_helper_pkg.writeTmp('Oracle error is ' ||
1261: SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE),FND_LOG.LEVEL_EXCEPTION, true);
1262: END LOOP;

Line 1260: bsc_mo_helper_pkg.writeTmp('Oracle error is ' ||

1256: bsc_mo_helper_pkg.writeTmp('Insert tables: Number of errors is ' || SQL%BULK_EXCEPTIONS.COUNT, FND_LOG.LEVEL_EXCEPTION, true);
1257: FOR i IN 1.. SQL%BULK_EXCEPTIONS.COUNT LOOP
1258: bsc_mo_helper_pkg.writeTmp('Error ' || i || ' occurred during '||
1259: 'iteration ' || SQL%BULK_EXCEPTIONS(i).ERROR_INDEX, FND_LOG.LEVEL_EXCEPTION, true);
1260: bsc_mo_helper_pkg.writeTmp('Oracle error is ' ||
1261: SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE),FND_LOG.LEVEL_EXCEPTION, true);
1262: END LOOP;
1263: END;
1264:

Line 1271: bsc_mo_helper_pkg.writeTmp('Insert Cols: Number of errors is ' || SQL%BULK_EXCEPTIONS.COUNT, FND_LOG.LEVEL_EXCEPTION, true);

1267: INSERT INTO BSC_DB_TABLES_COLS VALUES l_tab_db_tables_cols(i);
1268: EXCEPTION
1269: WHEN others THEN
1270:
1271: bsc_mo_helper_pkg.writeTmp('Insert Cols: Number of errors is ' || SQL%BULK_EXCEPTIONS.COUNT, FND_LOG.LEVEL_EXCEPTION, true);
1272: FOR i IN 1.. SQL%BULK_EXCEPTIONS.COUNT LOOP
1273: bsc_mo_helper_pkg.writeTmp('Error ' || i || ' occurred during '||
1274: 'iteration ' || SQL%BULK_EXCEPTIONS(i).ERROR_INDEX, FND_LOG.LEVEL_EXCEPTION, true);
1275: bsc_mo_helper_pkg.writeTmp('Oracle error is ' ||

Line 1273: bsc_mo_helper_pkg.writeTmp('Error ' || i || ' occurred during '||

1269: WHEN others THEN
1270:
1271: bsc_mo_helper_pkg.writeTmp('Insert Cols: Number of errors is ' || SQL%BULK_EXCEPTIONS.COUNT, FND_LOG.LEVEL_EXCEPTION, true);
1272: FOR i IN 1.. SQL%BULK_EXCEPTIONS.COUNT LOOP
1273: bsc_mo_helper_pkg.writeTmp('Error ' || i || ' occurred during '||
1274: 'iteration ' || SQL%BULK_EXCEPTIONS(i).ERROR_INDEX, FND_LOG.LEVEL_EXCEPTION, true);
1275: bsc_mo_helper_pkg.writeTmp('Oracle error is ' ||
1276: SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE),FND_LOG.LEVEL_EXCEPTION, true);
1277: END LOOP;

Line 1275: bsc_mo_helper_pkg.writeTmp('Oracle error is ' ||

1271: bsc_mo_helper_pkg.writeTmp('Insert Cols: Number of errors is ' || SQL%BULK_EXCEPTIONS.COUNT, FND_LOG.LEVEL_EXCEPTION, true);
1272: FOR i IN 1.. SQL%BULK_EXCEPTIONS.COUNT LOOP
1273: bsc_mo_helper_pkg.writeTmp('Error ' || i || ' occurred during '||
1274: 'iteration ' || SQL%BULK_EXCEPTIONS(i).ERROR_INDEX, FND_LOG.LEVEL_EXCEPTION, true);
1275: bsc_mo_helper_pkg.writeTmp('Oracle error is ' ||
1276: SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE),FND_LOG.LEVEL_EXCEPTION, true);
1277: END LOOP;
1278: END;
1279:

Line 1291: BSC_MO_HELPER_PKG.CHeckError('BSC_UPDATE.Configure_Periodicity_Calc_VB');

1287: Tabla := BSC_METADATA_OPTIMIZER_PKG.gTables(l_index1);
1288: -- bug 4581847, should call this for production tables also
1289: If isBasicTable(Tabla.Name) Then
1290: BSC_UPDATE.Configure_Periodicity_Calc_VB(tabla.name);
1291: BSC_MO_HELPER_PKG.CHeckError('BSC_UPDATE.Configure_Periodicity_Calc_VB');
1292: End If;
1293: EXIT WHEN l_index1 = BSC_METADATA_OPTIMIZER_PKG.gTables.last;
1294: l_index1 := BSC_METADATA_OPTIMIZER_PKG.gTables.next(l_index1);
1295: END LOOP;

Line 1296: BSC_MO_HELPER_PKG.writeTmp('Going to configure Profit Calculations '||bsc_mo_helper_pkg.get_time, FND_LOG.LEVEL_STATEMENT, true);

1292: End If;
1293: EXIT WHEN l_index1 = BSC_METADATA_OPTIMIZER_PKG.gTables.last;
1294: l_index1 := BSC_METADATA_OPTIMIZER_PKG.gTables.next(l_index1);
1295: END LOOP;
1296: BSC_MO_HELPER_PKG.writeTmp('Going to configure Profit Calculations '||bsc_mo_helper_pkg.get_time, FND_LOG.LEVEL_STATEMENT, true);
1297:
1298: --BSC-MV Note: Now that all the Loader metadata is configured, We need to configure
1299: --the Profit calculation in the base tables. It is going to call a Loader API
1300: --to do it. The same API is re-used in upgrade.

Line 1302: BSC_MO_HELPER_PKG.CheckError('BSC_UPDATE.Configure_Profit_Calc_VB');

1298: --BSC-MV Note: Now that all the Loader metadata is configured, We need to configure
1299: --the Profit calculation in the base tables. It is going to call a Loader API
1300: --to do it. The same API is re-used in upgrade.
1301: BSC_UPDATE.Configure_Profit_Calc_VB;
1302: BSC_MO_HELPER_PKG.CheckError('BSC_UPDATE.Configure_Profit_Calc_VB');
1303: End If;
1304:
1305: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
1306: BSC_MO_HELPER_PKG.writeTmp('Completed Loader Configuration '||bsc_mo_helper_pkg.get_time);

Line 1306: BSC_MO_HELPER_PKG.writeTmp('Completed Loader Configuration '||bsc_mo_helper_pkg.get_time);

1302: BSC_MO_HELPER_PKG.CheckError('BSC_UPDATE.Configure_Profit_Calc_VB');
1303: End If;
1304:
1305: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
1306: BSC_MO_HELPER_PKG.writeTmp('Completed Loader Configuration '||bsc_mo_helper_pkg.get_time);
1307: END IF;
1308:
1309: EXCEPTION WHEN OTHERS THEN
1310: bsc_mo_helper_pkg.writeTmp( ' Exception in Loader Configuration:'||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);

Line 1310: bsc_mo_helper_pkg.writeTmp( ' Exception in Loader Configuration:'||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);

1306: BSC_MO_HELPER_PKG.writeTmp('Completed Loader Configuration '||bsc_mo_helper_pkg.get_time);
1307: END IF;
1308:
1309: EXCEPTION WHEN OTHERS THEN
1310: bsc_mo_helper_pkg.writeTmp( ' Exception in Loader Configuration:'||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);
1311: fnd_message.set_name('BSC', 'BSC_LOAD_CONFIGURATION_FAILED');
1312: app_exception.raise_exception;
1313: RAISE;
1314: End;

Line 1368: bsc_mo_helper_pkg.writeTmp('Inside ReConfigureUploadFieldsIndic');

1364: l_optimizationMode number := 1;
1365: l_count number;
1366: l_cols_used VARCHAR2(32000);
1367: BEGIN
1368: bsc_mo_helper_pkg.writeTmp('Inside ReConfigureUploadFieldsIndic');
1369: --Get the list of configurations of the kpi
1370: colConfiguraciones := BSC_MO_INDICATOR_PKG.GetConfigurationsForIndic(Indic);
1371: IF (colConfiguraciones.count=0) THEN
1372: bsc_mo_helper_pkg.writeTmp('Completed ReConfigureUploadFieldsIndic, 0 count');

Line 1372: bsc_mo_helper_pkg.writeTmp('Completed ReConfigureUploadFieldsIndic, 0 count');

1368: bsc_mo_helper_pkg.writeTmp('Inside ReConfigureUploadFieldsIndic');
1369: --Get the list of configurations of the kpi
1370: colConfiguraciones := BSC_MO_INDICATOR_PKG.GetConfigurationsForIndic(Indic);
1371: IF (colConfiguraciones.count=0) THEN
1372: bsc_mo_helper_pkg.writeTmp('Completed ReConfigureUploadFieldsIndic, 0 count');
1373: return;
1374: END IF;
1375:
1376: l_index1 := colConfiguraciones.first;

Line 1387: bsc_mo_helper_pkg.write_this(colDatos, FND_LOG.LEVEL_STATEMENT, false);

1383: --including the target tables created for the indicator
1384: InitarrTablesIndic( Indic, Configuracion, arrTables, numTables, arrIndicTables, numIndicTables);
1385: --Initialize the collection of data columns of the indicator
1386: colDatos := BSC_MO_INDICATOR_PKG.GetDataFields(Indic, Configuracion, True);
1387: bsc_mo_helper_pkg.write_this(colDatos, FND_LOG.LEVEL_STATEMENT, false);
1388: --Reconfigure
1389: --The only non-structural changes that could happen are:
1390: --Change in the rollup method
1391: --Change in the projection method

Line 1393: bsc_mo_helper_pkg.addStack (l_stack, ' NumTables = '||numTables);

1389: --The only non-structural changes that could happen are:
1390: --Change in the rollup method
1391: --Change in the projection method
1392: --Change on the rollup to formula option
1393: bsc_mo_helper_pkg.addStack (l_stack, ' NumTables = '||numTables);
1394: bsc_mo_helper_pkg.writeTmp(' NumTables = '||numTables);
1395: For i IN arrTables.first..arrTables.last LOOP
1396: l_table_type := GetIndicTableType(arrTables(i), arrIndicTables, numIndicTables);
1397: bsc_mo_helper_pkg.addStack (l_stack, ' Table = '||arrTables(i)||', l_table_type = '||l_table_type);

Line 1394: bsc_mo_helper_pkg.writeTmp(' NumTables = '||numTables);

1390: --Change in the rollup method
1391: --Change in the projection method
1392: --Change on the rollup to formula option
1393: bsc_mo_helper_pkg.addStack (l_stack, ' NumTables = '||numTables);
1394: bsc_mo_helper_pkg.writeTmp(' NumTables = '||numTables);
1395: For i IN arrTables.first..arrTables.last LOOP
1396: l_table_type := GetIndicTableType(arrTables(i), arrIndicTables, numIndicTables);
1397: bsc_mo_helper_pkg.addStack (l_stack, ' Table = '||arrTables(i)||', l_table_type = '||l_table_type);
1398: bsc_mo_helper_pkg.writeTmp(' Table = '||arrTables(i)||', l_table_type = '||l_table_type);

Line 1397: bsc_mo_helper_pkg.addStack (l_stack, ' Table = '||arrTables(i)||', l_table_type = '||l_table_type);

1393: bsc_mo_helper_pkg.addStack (l_stack, ' NumTables = '||numTables);
1394: bsc_mo_helper_pkg.writeTmp(' NumTables = '||numTables);
1395: For i IN arrTables.first..arrTables.last LOOP
1396: l_table_type := GetIndicTableType(arrTables(i), arrIndicTables, numIndicTables);
1397: bsc_mo_helper_pkg.addStack (l_stack, ' Table = '||arrTables(i)||', l_table_type = '||l_table_type);
1398: bsc_mo_helper_pkg.writeTmp(' Table = '||arrTables(i)||', l_table_type = '||l_table_type);
1399: If l_table_type <> 0 Then --It is not an input table
1400: IF (colDatos.count > 0) THEN
1401: l_index2 := colDatos.First;

Line 1398: bsc_mo_helper_pkg.writeTmp(' Table = '||arrTables(i)||', l_table_type = '||l_table_type);

1394: bsc_mo_helper_pkg.writeTmp(' NumTables = '||numTables);
1395: For i IN arrTables.first..arrTables.last LOOP
1396: l_table_type := GetIndicTableType(arrTables(i), arrIndicTables, numIndicTables);
1397: bsc_mo_helper_pkg.addStack (l_stack, ' Table = '||arrTables(i)||', l_table_type = '||l_table_type);
1398: bsc_mo_helper_pkg.writeTmp(' Table = '||arrTables(i)||', l_table_type = '||l_table_type);
1399: If l_table_type <> 0 Then --It is not an input table
1400: IF (colDatos.count > 0) THEN
1401: l_index2 := colDatos.First;
1402: END IF;

Line 1407: bsc_mo_helper_pkg.writeTmp('Processing '||l_measure.fieldName);

1403: LOOP
1404: EXIT WHEN colDatos.count = 0;
1405: l_measure := colDatos(l_index2);
1406: newColumnFlag := False;
1407: bsc_mo_helper_pkg.writeTmp('Processing '||l_measure.fieldName);
1408: If (l_table_type = 3) Or (l_table_type = 4) Then
1409: --BSC-MV Note: In this Architecture there COULD be a projection
1410: --table created for target at different levels. In this case we
1411: --need to add this new column to the projection table.

Line 1413: l_optimizationMode := bsc_mo_helper_pkg.getKPIPropertyValue(Indic, 'DB_TRANSFORM', 1);

1409: --BSC-MV Note: In this Architecture there COULD be a projection
1410: --table created for target at different levels. In this case we
1411: --need to add this new column to the projection table.
1412: If BSC_METADATA_OPTIMIZER_PKG.G_BSC_MV Then
1413: l_optimizationMode := bsc_mo_helper_pkg.getKPIPropertyValue(Indic, 'DB_TRANSFORM', 1);
1414: IF (l_optimizationMode = 2) THEN -- targets at different levels, PT tables shd exist
1415: l_table_name := BSC_MO_INDICATOR_PKG.GetProjectionTableName(arrTables(i));
1416: ELSE
1417: l_table_name := arrTables(i);

Line 1422: bsc_mo_helper_pkg.addStack (l_stack, ' Check1 : l_table_name = '||l_table_name);

1418: END IF;
1419: Else
1420: l_table_name := arrTables(i);
1421: End If;
1422: bsc_mo_helper_pkg.addStack (l_stack, ' Check1 : l_table_name = '||l_table_name);
1423: --This is table used directly by the indicator
1424: --We need to make sure that the internal column exists
1425: If substr(l_measure.fieldName, 1, 5) = 'BSCIC' Then
1426: IF (BSC_METADATA_OPTIMIZER_PKG.G_BSC_MV =false) OR (BSC_METADATA_OPTIMIZER_PKG.G_BSC_MV AND l_optimizationMode=2) THEN

Line 1427: If Not BSC_MO_HELPER_PKG.table_column_exists(l_table_name, l_measure.fieldName) Then

1423: --This is table used directly by the indicator
1424: --We need to make sure that the internal column exists
1425: If substr(l_measure.fieldName, 1, 5) = 'BSCIC' Then
1426: IF (BSC_METADATA_OPTIMIZER_PKG.G_BSC_MV =false) OR (BSC_METADATA_OPTIMIZER_PKG.G_BSC_MV AND l_optimizationMode=2) THEN
1427: If Not BSC_MO_HELPER_PKG.table_column_exists(l_table_name, l_measure.fieldName) Then
1428: --Add the internal column
1429: ddl_sql := 'ALTER TABLE ' || l_table_name ||' ADD ' || l_measure.fieldName ||' NUMBER ';
1430: begin
1431: BSC_MO_HELPER_PKG.Do_DDL( ddl_sql , ad_ddl.alter_table, l_table_name);

Line 1431: BSC_MO_HELPER_PKG.Do_DDL( ddl_sql , ad_ddl.alter_table, l_table_name);

1427: If Not BSC_MO_HELPER_PKG.table_column_exists(l_table_name, l_measure.fieldName) Then
1428: --Add the internal column
1429: ddl_sql := 'ALTER TABLE ' || l_table_name ||' ADD ' || l_measure.fieldName ||' NUMBER ';
1430: begin
1431: BSC_MO_HELPER_PKG.Do_DDL( ddl_sql , ad_ddl.alter_table, l_table_name);
1432: newColumnFlag := True;
1433: exception when others then
1434: BSC_MO_HELPER_PKG.writeTmp('Error while executing : '||ddl_sql||', Error is '||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);
1435: raise;

Line 1434: BSC_MO_HELPER_PKG.writeTmp('Error while executing : '||ddl_sql||', Error is '||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);

1430: begin
1431: BSC_MO_HELPER_PKG.Do_DDL( ddl_sql , ad_ddl.alter_table, l_table_name);
1432: newColumnFlag := True;
1433: exception when others then
1434: BSC_MO_HELPER_PKG.writeTmp('Error while executing : '||ddl_sql||', Error is '||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);
1435: raise;
1436: end;
1437: End If;
1438: END IF;

Line 1444: BSC_MO_HELPER_PKG.writeTmp('MV arch, l_count= '||l_count||' for '||l_table_name ||' field='||l_measure.fieldName);

1440: IF (BSC_METADATA_OPTIMIZER_PKG.G_BSC_MV) THEN
1441: SELECT COUNT(1) INTO l_count
1442: FROM BSC_DB_TABLES_COLS
1443: WHERE table_name=l_table_name AND column_name=l_measure.fieldName;
1444: BSC_MO_HELPER_PKG.writeTmp('MV arch, l_count= '||l_count||' for '||l_table_name ||' field='||l_measure.fieldName);
1445: IF (l_count=0) THEN
1446: newColumnFlag := true;
1447: BSC_MO_HELPER_PKG.writeTmp('Setting new col flag to true');
1448: END IF;

Line 1447: BSC_MO_HELPER_PKG.writeTmp('Setting new col flag to true');

1443: WHERE table_name=l_table_name AND column_name=l_measure.fieldName;
1444: BSC_MO_HELPER_PKG.writeTmp('MV arch, l_count= '||l_count||' for '||l_table_name ||' field='||l_measure.fieldName);
1445: IF (l_count=0) THEN
1446: newColumnFlag := true;
1447: BSC_MO_HELPER_PKG.writeTmp('Setting new col flag to true');
1448: END IF;
1449: END IF;
1450: End If;
1451: bsc_mo_helper_pkg.addStack (l_stack, ' Chkpt2 ');

Line 1451: bsc_mo_helper_pkg.addStack (l_stack, ' Chkpt2 ');

1447: BSC_MO_HELPER_PKG.writeTmp('Setting new col flag to true');
1448: END IF;
1449: END IF;
1450: End If;
1451: bsc_mo_helper_pkg.addStack (l_stack, ' Chkpt2 ');
1452: End If;
1453: --BSC_DB_CALCULATIONS (Zero code calculation)
1454: If ((l_table_type = 3) Or (l_table_type = 4)) And (l_measure.AvgLFlag = 'Y') Then
1455: --This is table used directly by the indicator

Line 1462: bsc_mo_helper_pkg.addStack (l_stack, ' Chkpt3 ');

1458: l_measure.AvgLCounterColumn ||')');
1459: Else
1460: ZeroCodeOrigin := l_measure.aggFunction || '(' || l_measure.fieldName || ')';
1461: End If;
1462: bsc_mo_helper_pkg.addStack (l_stack, ' Chkpt3 ');
1463: If newColumnFlag Then
1464: --This is a internal column that was added to the indicator table
1465: --If the table does not calculate zero code then no record is inserted
1466: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN

Line 1467: BSC_MO_HELPER_PKG.writeTmp('4 INSERT DB_CALCULATIONS:');

1463: If newColumnFlag Then
1464: --This is a internal column that was added to the indicator table
1465: --If the table does not calculate zero code then no record is inserted
1466: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
1467: BSC_MO_HELPER_PKG.writeTmp('4 INSERT DB_CALCULATIONS:');
1468: END IF;
1469: l_stmt := 'INSERT INTO BSC_DB_CALCULATIONS (TABLE_NAME, CALCULATION_TYPE, PARAMETER1, PARAMETER2 '||
1470: ', PARAMETER3, PARAMETER4, PARAMETER5) '||
1471: ' SELECT DISTINCT TABLE_NAME, CALCULATION_TYPE, PARAMETER1, PARAMETER2, :1, parameter4, :2 FROM BSC_DB_CALCULATIONS '||

Line 1473: bsc_mo_helper_pkg.addStack (l_stack, ' Chkpt4.1, L_STMT = '||l_stmt);

1469: l_stmt := 'INSERT INTO BSC_DB_CALCULATIONS (TABLE_NAME, CALCULATION_TYPE, PARAMETER1, PARAMETER2 '||
1470: ', PARAMETER3, PARAMETER4, PARAMETER5) '||
1471: ' SELECT DISTINCT TABLE_NAME, CALCULATION_TYPE, PARAMETER1, PARAMETER2, :1, parameter4, :2 FROM BSC_DB_CALCULATIONS '||
1472: ' WHERE TABLE_NAME = :3 AND CALCULATION_TYPE = 4';
1473: bsc_mo_helper_pkg.addStack (l_stack, ' Chkpt4.1, L_STMT = '||l_stmt);
1474: INSERT INTO BSC_DB_CALCULATIONS
1475: (TABLE_NAME, CALCULATION_TYPE, PARAMETER1, PARAMETER2
1476: , PARAMETER3, PARAMETER4, PARAMETER5)
1477: SELECT DISTINCT

Line 1484: BSC_MO_HELPER_PKG.writeTmp('4 UPDATE DB_CALCULATIONS:');

1480: FROM BSC_DB_CALCULATIONS
1481: WHERE TABLE_NAME = UPPER(arrTables(i)) AND CALCULATION_TYPE = 4;
1482: Else
1483: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
1484: BSC_MO_HELPER_PKG.writeTmp('4 UPDATE DB_CALCULATIONS:');
1485: END IF;
1486: --If the table does not calculate zero code then no record is updated
1487: l_stmt := 'UPDATE BSC_DB_CALCULATIONS SET PARAMETER5 = :1 WHERE '||
1488: ' TABLE_NAME = :2 AND PARAMETER3 = :3 AND CALCULATION_TYPE = 4 ';

Line 1489: bsc_mo_helper_pkg.writeTmp(' Chkpt4.2, L_STMT = '||l_stmt||', :1='||ZeroCodeOrigin||', :2='||UPPER(arrTables(i))||', :3='||

1485: END IF;
1486: --If the table does not calculate zero code then no record is updated
1487: l_stmt := 'UPDATE BSC_DB_CALCULATIONS SET PARAMETER5 = :1 WHERE '||
1488: ' TABLE_NAME = :2 AND PARAMETER3 = :3 AND CALCULATION_TYPE = 4 ';
1489: bsc_mo_helper_pkg.writeTmp(' Chkpt4.2, L_STMT = '||l_stmt||', :1='||ZeroCodeOrigin||', :2='||UPPER(arrTables(i))||', :3='||
1490: l_measure.fieldName);
1491: UPDATE BSC_DB_CALCULATIONS
1492: SET PARAMETER5 = ZeroCodeOrigin
1493: WHERE

Line 1503: BSC_MO_HELPER_PKG.writeTmp('5 INSERT DB_CALCULATIONS:');

1499: --No changes for current columns
1500: If newColumnFlag Then
1501: --This is a internal column that was added to the indicator table
1502: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
1503: BSC_MO_HELPER_PKG.writeTmp('5 INSERT DB_CALCULATIONS:');
1504: END IF;
1505: l_stmt:= 'INSERT INTO BSC_DB_CALCULATIONS (TABLE_NAME, CALCULATION_TYPE, PARAMETER1, PARAMETER2) '||
1506: ' SELECT DISTINCT TABLE_NAME, CALCULATION_TYPE, PARAMETER1, :2'||
1507: ' FROM BSC_DB_CALCULATIONS WHERE TABLE_NAME = :2 AND CALCULATION_TYPE = 5';

Line 1508: bsc_mo_helper_pkg.addStack (l_stack, ' Chkpt4.3, L_STMT = '||l_stmt);

1504: END IF;
1505: l_stmt:= 'INSERT INTO BSC_DB_CALCULATIONS (TABLE_NAME, CALCULATION_TYPE, PARAMETER1, PARAMETER2) '||
1506: ' SELECT DISTINCT TABLE_NAME, CALCULATION_TYPE, PARAMETER1, :2'||
1507: ' FROM BSC_DB_CALCULATIONS WHERE TABLE_NAME = :2 AND CALCULATION_TYPE = 5';
1508: bsc_mo_helper_pkg.addStack (l_stack, ' Chkpt4.3, L_STMT = '||l_stmt);
1509: INSERT INTO BSC_DB_CALCULATIONS(TABLE_NAME, CALCULATION_TYPE, PARAMETER1, PARAMETER2)
1510: SELECT DISTINCT TABLE_NAME, CALCULATION_TYPE, PARAMETER1, l_measure.fieldName
1511: FROM BSC_DB_CALCULATIONS
1512: WHERE TABLE_NAME = UPPER(arrTables(i))

Line 1536: bsc_mo_helper_pkg.addStack (l_stack, ' Chkpt5.1, l_source = '||l_source);

1532: ELSIF (l_measure.InternalColumnType=3) THEN
1533: --Case 3 --Counter for Average at Lowest Level
1534: l_source := BSC_MO_INDICATOR_PKG.GetFreeDivZeroExpression('COUNT(' || l_measure.InternalColumnSource || ')');
1535: End IF;
1536: bsc_mo_helper_pkg.addStack (l_stack, ' Chkpt5.1, l_source = '||l_source);
1537: ELSIF (l_table_type =4) THEN
1538: --Case 4
1539: --The table is originated from another indicator table
1540: If l_measure.AvgLFlag = 'Y' Then

Line 1546: bsc_mo_helper_pkg.addStack (l_stack, ' Chkpt5.1b, l_source = '||l_source);

1542: l_measure.AvgLCounterColumn || ')');
1543: Else
1544: l_source := l_measure.aggFunction || '(' || l_measure.fieldName || ')';
1545: End If;
1546: bsc_mo_helper_pkg.addStack (l_stack, ' Chkpt5.1b, l_source = '||l_source);
1547: ELSE -- Case else
1548: --Base tables, temporal tables
1549: l_source := l_measure.aggFunction || '(' || l_measure.fieldName || ')';
1550: bsc_mo_helper_pkg.addStack (l_stack, ' Chkpt5.1c, l_source = '||l_source);

Line 1550: bsc_mo_helper_pkg.addStack (l_stack, ' Chkpt5.1c, l_source = '||l_source);

1546: bsc_mo_helper_pkg.addStack (l_stack, ' Chkpt5.1b, l_source = '||l_source);
1547: ELSE -- Case else
1548: --Base tables, temporal tables
1549: l_source := l_measure.aggFunction || '(' || l_measure.fieldName || ')';
1550: bsc_mo_helper_pkg.addStack (l_stack, ' Chkpt5.1c, l_source = '||l_source);
1551: End IF;
1552: If newColumnFlag Then
1553: --This is a internal column that was added to the indicator table
1554: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN

Line 1555: BSC_MO_HELPER_PKG.writeTmp('INSERT DB_TABLES_COLS newcol: table_name='||

1551: End IF;
1552: If newColumnFlag Then
1553: --This is a internal column that was added to the indicator table
1554: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
1555: BSC_MO_HELPER_PKG.writeTmp('INSERT DB_TABLES_COLS newcol: table_name='||
1556: arrTables(i)||', column_type=A, column_name = '||l_measure.fieldName||', source_column='||l_source);
1557: END IF;
1558: INSERT INTO BSC_DB_TABLES_COLS (TABLE_NAME, COLUMN_TYPE, COLUMN_NAME, SOURCE, PROJECTION_ID, SOURCE_FORMULA)
1559: VALUES(upper(arrTables(i)), 'A', l_measure.fieldName, l_measure.source, 0, l_source);

Line 1562: BSC_MO_HELPER_PKG.writeTmp('UPDATE DB_TABLES_COLS newcol: table_name='||

1558: INSERT INTO BSC_DB_TABLES_COLS (TABLE_NAME, COLUMN_TYPE, COLUMN_NAME, SOURCE, PROJECTION_ID, SOURCE_FORMULA)
1559: VALUES(upper(arrTables(i)), 'A', l_measure.fieldName, l_measure.source, 0, l_source);
1560: Else
1561: IF BSC_METADATA_OPTIMIZER_PKG.g_log THEN
1562: BSC_MO_HELPER_PKG.writeTmp('UPDATE DB_TABLES_COLS newcol: table_name='||
1563: arrTables(i)||', column_type=A, column_name = '||l_measure.fieldName||', source='||l_measure.source||', source_column='||l_source);
1564: END IF;
1565: UPDATE BSC_DB_TABLES_COLS
1566: SET SOURCE_FORMULA = l_source

Line 1574: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gLov, l_measure.fieldName, l_measure.source);

1570: AND COLUMN_TYPE = 'A';
1571: End If;
1572: --BSC_DB_TABLES_COLS (Projection method)
1573: If CalcProjectionTable(arrTables(i)) Then
1574: l_temp := BSC_MO_HELPER_PKG.findIndex(BSC_METADATA_OPTIMIZER_PKG.gLov, l_measure.fieldName, l_measure.source);
1575: UPDATE BSC_DB_TABLES_COLS
1576: SET PROJECTION_ID = BSC_METADATA_OPTIMIZER_PKG.gLov(l_temp).PrjMethod
1577: WHERE TABLE_NAME = UPPER(arrTables(i))
1578: AND COLUMN_NAME = l_measure.fieldName

Line 1592: bsc_mo_helper_pkg.addStack (l_stack, ' Chk 8');

1588: --the sql statements configured in BSC_KPI_DATA_TABLES for zero codes
1589: If BSC_METADATA_OPTIMIZER_PKG.g_BSC_MV Then
1590:
1591: OPEN cRollups(indic, Configuracion);
1592: bsc_mo_helper_pkg.addStack (l_stack, ' Chk 8');
1593: zeroCodeDataColumns := null;
1594: LOOP
1595: FETCH cRollups INTO l_3, l_5;
1596: EXIT WHEN cRollups%NOTFOUND;

Line 1601: bsc_mo_helper_pkg.addStack (l_stack, ' Chk 9');

1597: zeroCodeDataColumns := zeroCodeDataColumns || ', ' || l_5|| ' ' || l_3;
1598: END Loop;
1599: Close cRollups;
1600: If zeroCodeDataColumns IS NOT NULL Then
1601: bsc_mo_helper_pkg.addStack (l_stack, ' Chk 9');
1602: l_stmt := ' UPDATE bsc_kpi_data_tables '||
1603: ' SET sql_stmt = SUBSTR(sql_stmt, 1, INSTR(sql_stmt, ''PERIOD_TYPE_ID'') - 1)||''PERIOD_TYPE_ID''||'''|| zeroCodeDataColumns || '''|| '||
1604: ' SUBSTR(sql_stmt, INSTR(sql_stmt, '' FROM ''))'||
1605: ' WHERE indicator = :1 ' ||

Line 1611: bsc_mo_helper_pkg.addStack (l_stack, ' Chk 10');

1607: ' AND sql_stmt IS NOT NULL';
1608:
1609: EXECUTE IMMEDIATE l_stmt USING Indic, Configuracion;
1610: End If;
1611: bsc_mo_helper_pkg.addStack (l_stack, ' Chk 10');
1612: End If;
1613:
1614:
1615: EXIT WHEN l_index1 = colConfiguraciones.last;

Line 1618: bsc_mo_helper_pkg.writeTmp('Completed ReConfigureUploadFieldsIndic');

1614:
1615: EXIT WHEN l_index1 = colConfiguraciones.last;
1616: l_index1 := colConfiguraciones.next(l_index1);
1617: END LOOP;
1618: bsc_mo_helper_pkg.writeTmp('Completed ReConfigureUploadFieldsIndic');
1619: EXCEPTION WHEN OTHERS THEN
1620: bsc_mo_helper_pkg.writeTmp('Exception in ReConfigureUploadFieldsIndic:'||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);
1621: bsc_mo_helper_pkg.writeTmp('Stack is : '||l_stack, FND_LOG.LEVEL_UNEXPECTED, true);
1622: raise;

Line 1620: bsc_mo_helper_pkg.writeTmp('Exception in ReConfigureUploadFieldsIndic:'||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);

1616: l_index1 := colConfiguraciones.next(l_index1);
1617: END LOOP;
1618: bsc_mo_helper_pkg.writeTmp('Completed ReConfigureUploadFieldsIndic');
1619: EXCEPTION WHEN OTHERS THEN
1620: bsc_mo_helper_pkg.writeTmp('Exception in ReConfigureUploadFieldsIndic:'||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);
1621: bsc_mo_helper_pkg.writeTmp('Stack is : '||l_stack, FND_LOG.LEVEL_UNEXPECTED, true);
1622: raise;
1623: End ;
1624:

Line 1621: bsc_mo_helper_pkg.writeTmp('Stack is : '||l_stack, FND_LOG.LEVEL_UNEXPECTED, true);

1617: END LOOP;
1618: bsc_mo_helper_pkg.writeTmp('Completed ReConfigureUploadFieldsIndic');
1619: EXCEPTION WHEN OTHERS THEN
1620: bsc_mo_helper_pkg.writeTmp('Exception in ReConfigureUploadFieldsIndic:'||sqlerrm, FND_LOG.LEVEL_UNEXPECTED, true);
1621: bsc_mo_helper_pkg.writeTmp('Stack is : '||l_stack, FND_LOG.LEVEL_UNEXPECTED, true);
1622: raise;
1623: End ;
1624:
1625: END BSC_MO_LOADER_CONFIG_PKG;