1102: -- so it is ok to truncate the tables
1103:
1104: g_phase := 'Truncate dimension hierarchy tables';
1105: FII_UTIL.truncate_table ('FII_FULL_COST_CTR_HIERS', 'FII', g_retcode);
1106: FII_UTIL.truncate_table ('FII_COST_CTR_HIERARCHIES', 'FII', g_retcode);
1107:
1108: INSERT INTO FII_FULL_COST_CTR_HIERS
1109: (parent_level,
1110: parent_cc_id,
1137: SYSDATE,
1138: FII_USER_ID,
1139: FII_LOGIN_ID);
1140:
1141: INSERT INTO FII_COST_CTR_HIERARCHIES
1142: (parent_level,
1143: parent_cc_id,
1144: next_level,
1145: next_level_cc_id,
1287:
1288: --Copy FII_CC_HIER_GT to the final (pruned) dimension table
1289: g_phase := 'Copy TMP hierarchy table to the final pruned dimension table';
1290:
1291: FII_UTIL.truncate_table ('FII_COST_CTR_HIERARCHIES', 'FII', g_retcode);
1292:
1293: INSERT /*+ APPEND */ INTO FII_COST_CTR_HIERARCHIES (
1294: parent_level,
1295: parent_cc_id,
1289: g_phase := 'Copy TMP hierarchy table to the final pruned dimension table';
1290:
1291: FII_UTIL.truncate_table ('FII_COST_CTR_HIERARCHIES', 'FII', g_retcode);
1292:
1293: INSERT /*+ APPEND */ INTO FII_COST_CTR_HIERARCHIES (
1294: parent_level,
1295: parent_cc_id,
1296: next_level,
1297: next_level_cc_id,
1337: FROM FII_COST_CTR_HIER_GT;
1338:
1339:
1340: IF (FIIDIM_Debug) THEN
1341: FII_UTIL.Write_Log('Inserted ' || SQL%ROWCOUNT || ' rows into FII_COST_CTR_HIERARCHIES');
1342: END IF;
1343:
1344: -- This will be in RSG data
1345: g_phase := 'gather_table_stats for FII_COST_CTR_HIERARCHIES';
1341: FII_UTIL.Write_Log('Inserted ' || SQL%ROWCOUNT || ' rows into FII_COST_CTR_HIERARCHIES');
1342: END IF;
1343:
1344: -- This will be in RSG data
1345: g_phase := 'gather_table_stats for FII_COST_CTR_HIERARCHIES';
1346: FND_STATS.gather_table_stats
1347: (ownname => g_schema_name,
1348: tabname => 'FII_COST_CTR_HIERARCHIES');
1349:
1344: -- This will be in RSG data
1345: g_phase := 'gather_table_stats for FII_COST_CTR_HIERARCHIES';
1346: FND_STATS.gather_table_stats
1347: (ownname => g_schema_name,
1348: tabname => 'FII_COST_CTR_HIERARCHIES');
1349:
1350: g_phase := 'gather_table_stats for MLOG$_FII_COST_CTR_HIERARC';
1351: FND_STATS.gather_table_stats
1352: (ownname => g_schema_name,
1494: g_phase := 'Copy TMP hierarchy table to the final pruned dimension table';
1495:
1496: -- Incremental Dimension Maintence
1497: -- All data is now in the temporary table FII_COST_CTR_HIER_GT,
1498: -- we need to maintain the permanent table FII_COST_CTR_HIERARCHIES
1499: -- by diffing the 2 tables.
1500: -- The maintenance is done by 2 statements, one INSERT and one DELETE.
1501:
1502: DELETE FROM FII_COST_CTR_HIERARCHIES
1498: -- we need to maintain the permanent table FII_COST_CTR_HIERARCHIES
1499: -- by diffing the 2 tables.
1500: -- The maintenance is done by 2 statements, one INSERT and one DELETE.
1501:
1502: DELETE FROM FII_COST_CTR_HIERARCHIES
1503: WHERE
1504: (parent_level, parent_cc_id, next_level,
1505: next_level_cc_id,
1506: next_level_is_leaf_flag, is_leaf_flag, child_level,
1518: child_flex_value_set_id, NVL(next_level_cc_sort_order, -92883), LEVEL2_CC_ID,
1519: LEVEL3_CC_ID,
1520: LEVEL4_CC_ID ,
1521: LEVEL5_CC_ID
1522: FROM FII_COST_CTR_HIERARCHIES
1523: MINUS
1524: SELECT parent_level, parent_cc_id,
1525: next_level, next_level_cc_id,
1526: next_level_is_leaf_flag, is_leaf_flag,
1533: FROM FII_COST_CTR_HIER_GT);
1534:
1535:
1536: IF (FIIDIM_Debug) THEN
1537: FII_UTIL.Write_Log('Deleted ' || SQL%ROWCOUNT || ' rows from FII_COST_CTR_HIERARCHIES');
1538: END IF;
1539:
1540: Insert into FII_COST_CTR_HIERARCHIES (
1541: parent_level,
1536: IF (FIIDIM_Debug) THEN
1537: FII_UTIL.Write_Log('Deleted ' || SQL%ROWCOUNT || ' rows from FII_COST_CTR_HIERARCHIES');
1538: END IF;
1539:
1540: Insert into FII_COST_CTR_HIERARCHIES (
1541: parent_level,
1542: parent_cc_id,
1543: next_level,
1544: next_level_cc_id,
1602: FII_USER_ID,
1603: SYSDATE,
1604: FII_USER_ID,
1605: FII_LOGIN_ID
1606: FROM FII_COST_CTR_HIERARCHIES);
1607:
1608: IF (FIIDIM_Debug) THEN
1609: FII_UTIL.Write_Log('Inserted ' || SQL%ROWCOUNT || ' rows into FII_COST_CTR_HIERARCHIES');
1610: END IF;
1605: FII_LOGIN_ID
1606: FROM FII_COST_CTR_HIERARCHIES);
1607:
1608: IF (FIIDIM_Debug) THEN
1609: FII_UTIL.Write_Log('Inserted ' || SQL%ROWCOUNT || ' rows into FII_COST_CTR_HIERARCHIES');
1610: END IF;
1611:
1612: -- This is in RSG data
1613: g_phase := 'gather_table_stats for FII_COST_CTR_HIERARCHIES';
1609: FII_UTIL.Write_Log('Inserted ' || SQL%ROWCOUNT || ' rows into FII_COST_CTR_HIERARCHIES');
1610: END IF;
1611:
1612: -- This is in RSG data
1613: g_phase := 'gather_table_stats for FII_COST_CTR_HIERARCHIES';
1614: FND_STATS.gather_table_stats
1615: (ownname => g_schema_name,
1616: tabname => 'FII_COST_CTR_HIERARCHIES');
1617:
1612: -- This is in RSG data
1613: g_phase := 'gather_table_stats for FII_COST_CTR_HIERARCHIES';
1614: FND_STATS.gather_table_stats
1615: (ownname => g_schema_name,
1616: tabname => 'FII_COST_CTR_HIERARCHIES');
1617:
1618: -- Bug 4200473. Not to analyze MLOG in incremental run.
1619: -- As per performance teams suggestions.
1620: -- g_phase := 'gather_table_stats for MLOG$_FII_COST_CTR_HIERARC';