1095: END Delete_LVS_Records;
1096:
1097:
1098: -- **************************************************************************
1099: -- Populate FII_FIN_CAT_MAPPINGS_GT Table for FIN_CAT_MAPPINGS
1100:
1101: PROCEDURE Get_FC_Mapping_GT IS
1102:
1103: Begin
1106: FII_MESSAGE.Func_Ent(func_name => 'FII_FIN_CAT_MAINTAIN_PKG.'||
1107: 'Get_FC_Mapping_GT');
1108: END IF;
1109:
1110: --First, populate FII_FIN_CAT_MAPPINGS_GT with the truncated portion
1111: --of the financial category hierarchy.
1112: --Note this already includes all self leaf records
1113: g_phase := 'populate FII_FIN_CAT_MAPPINGS_GT with truncated portion';
1114:
1109:
1110: --First, populate FII_FIN_CAT_MAPPINGS_GT with the truncated portion
1111: --of the financial category hierarchy.
1112: --Note this already includes all self leaf records
1113: g_phase := 'populate FII_FIN_CAT_MAPPINGS_GT with truncated portion';
1114:
1115: INSERT INTO FII_FIN_CAT_MAPPINGS_GT
1116: (parent_fin_cat_id,
1117: child_fin_cat_id)
1111: --of the financial category hierarchy.
1112: --Note this already includes all self leaf records
1113: g_phase := 'populate FII_FIN_CAT_MAPPINGS_GT with truncated portion';
1114:
1115: INSERT INTO FII_FIN_CAT_MAPPINGS_GT
1116: (parent_fin_cat_id,
1117: child_fin_cat_id)
1118: SELECT fh.parent_fin_cat_id,
1119: fh.child_fin_cat_id
1123: FROM FII_FIN_ITEM_HIERARCHIES ph
1124: WHERE ph.is_leaf_flag = 'Y');
1125:
1126: IF (FIIDIM_Debug) THEN
1127: FII_UTIL.Write_Log('Inserted ' || SQL%ROWCOUNT || ' rows into FII_FIN_CAT_MAPPINGS_GT');
1128: END IF;
1129:
1130: --Then, insert self-mapping records for all nodes in pruned hierarchy
1131: --FII_FIN_ITEM_HIERARCHIES. Note we should exclude all self leaf
1131: --FII_FIN_ITEM_HIERARCHIES. Note we should exclude all self leaf
1132: --records since they are inserted in the previous step.
1133: g_phase := 'insert self-mapping records for all nodes in pruned hierarchy';
1134:
1135: INSERT INTO FII_FIN_CAT_MAPPINGS_GT
1136: (parent_fin_cat_id,
1137: child_fin_cat_id)
1138: SELECT parent_fin_cat_id,
1139: child_fin_cat_id
1142: AND parent_fin_cat_id = child_fin_cat_id
1143: AND is_leaf_flag = 'N';
1144:
1145: IF (FIIDIM_Debug) THEN
1146: FII_UTIL.Write_Log('Inserted ' || SQL%ROWCOUNT || ' rows into FII_FIN_CAT_MAPPINGS_GT');
1147: END IF;
1148:
1149: --Call FND_STATS to collect statistics after populating the table
1150: g_phase := 'gather_table_stats for FII_FIN_CAT_MAPPINGS_GT';
1146: FII_UTIL.Write_Log('Inserted ' || SQL%ROWCOUNT || ' rows into FII_FIN_CAT_MAPPINGS_GT');
1147: END IF;
1148:
1149: --Call FND_STATS to collect statistics after populating the table
1150: g_phase := 'gather_table_stats for FII_FIN_CAT_MAPPINGS_GT';
1151:
1152: FND_STATS.gather_table_stats
1153: (ownname => g_schema_name,
1154: tabname => 'FII_FIN_CAT_MAPPINGS_GT');
1150: g_phase := 'gather_table_stats for FII_FIN_CAT_MAPPINGS_GT';
1151:
1152: FND_STATS.gather_table_stats
1153: (ownname => g_schema_name,
1154: tabname => 'FII_FIN_CAT_MAPPINGS_GT');
1155:
1156: IF (FIIDIM_Debug) THEN
1157: FII_MESSAGE.Func_Succ(func_name => 'FII_FIN_CAT_MAINTAIN_PKG.Get_FC_Mapping_GT');
1158: END IF;
1584: END IF;
1585:
1586: FII_UTIL.truncate_table ('FII_FULL_FIN_ITEM_HIERS', 'FII', g_retcode);
1587: FII_UTIL.truncate_table ('FII_FIN_ITEM_HIERARCHIES', 'FII', g_retcode);
1588: FII_UTIL.truncate_table ('FII_FIN_CAT_MAPPINGS', 'FII', g_retcode);
1589: FII_UTIL.truncate_table ('FII_FIN_CAT_TYPE_ASSGNS', 'FII', g_retcode);
1590: FII_UTIL.truncate_table ('FII_FIN_ITEM_LEAF_HIERS', 'FII', g_retcode);
1591: FII_UTIL.truncate_table ('FII_FIN_CAT_LEAF_MAPS', 'FII', g_retcode);
1592:
1817: --it in parallel (due to the hint APPEND)
1818: commit;
1819:
1820: --================================================================--
1821: --Populate FII_FIN_CAT_MAPPINGS table
1822: g_phase := 'Populate FII_FIN_CAT_MAPPINGS_GT table';
1823:
1824: Get_FC_Mapping_GT;
1825:
1818: commit;
1819:
1820: --================================================================--
1821: --Populate FII_FIN_CAT_MAPPINGS table
1822: g_phase := 'Populate FII_FIN_CAT_MAPPINGS_GT table';
1823:
1824: Get_FC_Mapping_GT;
1825:
1826: --Copy FII_FIN_CAT_MAPPINGS_GT to FII_FIN_CAT_LEAF_MAPS
1822: g_phase := 'Populate FII_FIN_CAT_MAPPINGS_GT table';
1823:
1824: Get_FC_Mapping_GT;
1825:
1826: --Copy FII_FIN_CAT_MAPPINGS_GT to FII_FIN_CAT_LEAF_MAPS
1827: g_phase := 'Copy TMP FC Mapping table to the FC Mapping Table';
1828:
1829: FII_UTIL.truncate_table ('FII_FIN_CAT_LEAF_MAPS', 'FII', g_retcode);
1830:
1843: FII_USER_ID,
1844: SYSDATE,
1845: FII_USER_ID,
1846: FII_LOGIN_ID
1847: FROM FII_FIN_CAT_MAPPINGS_GT;
1848:
1849: IF (FIIDIM_Debug) THEN
1850: FII_UTIL.Write_Log('Inserted ' || SQL%ROWCOUNT || ' rows into FII_FIN_CAT_LEAF_MAPS');
1851: END IF;
1849: IF (FIIDIM_Debug) THEN
1850: FII_UTIL.Write_Log('Inserted ' || SQL%ROWCOUNT || ' rows into FII_FIN_CAT_LEAF_MAPS');
1851: END IF;
1852:
1853: --Copy FII_FIN_CAT_MAPPINGS_GT to FII_FIN_CAT_MAPPINGS
1854: g_phase := 'Copy TMP FC Mapping table to the FC Mapping Table';
1855:
1856: FII_UTIL.truncate_table ('FII_FIN_CAT_MAPPINGS', 'FII', g_retcode);
1857:
1852:
1853: --Copy FII_FIN_CAT_MAPPINGS_GT to FII_FIN_CAT_MAPPINGS
1854: g_phase := 'Copy TMP FC Mapping table to the FC Mapping Table';
1855:
1856: FII_UTIL.truncate_table ('FII_FIN_CAT_MAPPINGS', 'FII', g_retcode);
1857:
1858: INSERT /*+ APPEND */ INTO FII_FIN_CAT_MAPPINGS (
1859: parent_fin_cat_id,
1860: child_fin_cat_id,
1854: g_phase := 'Copy TMP FC Mapping table to the FC Mapping Table';
1855:
1856: FII_UTIL.truncate_table ('FII_FIN_CAT_MAPPINGS', 'FII', g_retcode);
1857:
1858: INSERT /*+ APPEND */ INTO FII_FIN_CAT_MAPPINGS (
1859: parent_fin_cat_id,
1860: child_fin_cat_id,
1861: creation_date,
1862: created_by,
1870: FII_USER_ID,
1871: SYSDATE,
1872: FII_USER_ID,
1873: FII_LOGIN_ID
1874: FROM FII_FIN_CAT_MAPPINGS_GT;
1875:
1876: IF (FIIDIM_Debug) THEN
1877: FII_UTIL.Write_Log('Inserted ' || SQL%ROWCOUNT || ' rows into FII_FIN_CAT_MAPPINGS');
1878: END IF;
1873: FII_LOGIN_ID
1874: FROM FII_FIN_CAT_MAPPINGS_GT;
1875:
1876: IF (FIIDIM_Debug) THEN
1877: FII_UTIL.Write_Log('Inserted ' || SQL%ROWCOUNT || ' rows into FII_FIN_CAT_MAPPINGS');
1878: END IF;
1879:
1880: --Call FND_STATS to collect statistics after re-populating the table.
1881:
1878: END IF;
1879:
1880: --Call FND_STATS to collect statistics after re-populating the table.
1881:
1882: g_phase := 'gather_table_stats FII_FIN_CAT_MAPPINGS';
1883:
1884: FND_STATS.gather_table_stats
1885: (ownname => g_schema_name,
1886: tabname => 'FII_FIN_CAT_MAPPINGS');
1882: g_phase := 'gather_table_stats FII_FIN_CAT_MAPPINGS';
1883:
1884: FND_STATS.gather_table_stats
1885: (ownname => g_schema_name,
1886: tabname => 'FII_FIN_CAT_MAPPINGS');
1887:
1888: g_phase := 'gather_table_stats MLOG$_FII_FIN_CAT_MAPPINGS';
1889:
1890: FND_STATS.gather_table_stats
1884: FND_STATS.gather_table_stats
1885: (ownname => g_schema_name,
1886: tabname => 'FII_FIN_CAT_MAPPINGS');
1887:
1888: g_phase := 'gather_table_stats MLOG$_FII_FIN_CAT_MAPPINGS';
1889:
1890: FND_STATS.gather_table_stats
1891: (ownname => g_schema_name,
1892: tabname => 'MLOG$_FII_FIN_CAT_MAPPINGS');
1888: g_phase := 'gather_table_stats MLOG$_FII_FIN_CAT_MAPPINGS';
1889:
1890: FND_STATS.gather_table_stats
1891: (ownname => g_schema_name,
1892: tabname => 'MLOG$_FII_FIN_CAT_MAPPINGS');
1893:
1894: g_phase := 'gather_table_stats FII_FIN_CAT_LEAF_MAPS';
1895:
1896: FND_STATS.gather_table_stats
2361: -- (ownname => g_schema_name,
2362: -- tabname => 'FII_FIN_ITEM_HIERARCHIES');
2363:
2364: --================================================================--
2365: --Populate FII_FIN_CAT_MAPPINGS table
2366: g_phase := 'Populate FII_FIN_CAT_MAPPINGS_GT table';
2367:
2368: Get_FC_Mapping_GT;
2369:
2362: -- tabname => 'FII_FIN_ITEM_HIERARCHIES');
2363:
2364: --================================================================--
2365: --Populate FII_FIN_CAT_MAPPINGS table
2366: g_phase := 'Populate FII_FIN_CAT_MAPPINGS_GT table';
2367:
2368: Get_FC_Mapping_GT;
2369:
2370: --Copy FII_FIN_CAT_MAPPINGS_GT to FII_FIN_CAT_LEAF_MAPS
2366: g_phase := 'Populate FII_FIN_CAT_MAPPINGS_GT table';
2367:
2368: Get_FC_Mapping_GT;
2369:
2370: --Copy FII_FIN_CAT_MAPPINGS_GT to FII_FIN_CAT_LEAF_MAPS
2371: g_phase := 'DELETE FROM FII_FIN_CAT_LEAF_MAPS';
2372:
2373: DELETE FROM FII_FIN_CAT_LEAF_MAPS
2374: WHERE
2376: (SELECT parent_fin_cat_id, child_fin_cat_id
2377: FROM FII_FIN_CAT_LEAF_MAPS
2378: MINUS
2379: SELECT parent_fin_cat_id, child_fin_cat_id
2380: FROM FII_FIN_CAT_MAPPINGS_GT);
2381:
2382: IF (FIIDIM_Debug) THEN
2383: FII_UTIL.Write_Log('Deleted ' || SQL%ROWCOUNT || ' rows from FII_FIN_CAT_LEAF_MAPS');
2384: END IF;
2399: FII_USER_ID,
2400: SYSDATE,
2401: FII_USER_ID,
2402: FII_LOGIN_ID
2403: FROM FII_FIN_CAT_MAPPINGS_GT
2404: MINUS
2405: SELECT parent_fin_cat_id,
2406: child_fin_cat_id,
2407: SYSDATE,
2414: IF (FIIDIM_Debug) THEN
2415: FII_UTIL.Write_Log('Inserted ' || SQL%ROWCOUNT || ' rows into FII_FIN_CAT_LEAF_MAPS');
2416: END IF;
2417:
2418: --Copy FII_FIN_CAT_MAPPINGS_GT to FII_FIN_CAT_MAPPINGS
2419:
2420: g_phase := 'DELETE FROM FII_FIN_CAT_MAPPINGS';
2421:
2422: DELETE FROM FII_FIN_CAT_MAPPINGS
2416: END IF;
2417:
2418: --Copy FII_FIN_CAT_MAPPINGS_GT to FII_FIN_CAT_MAPPINGS
2419:
2420: g_phase := 'DELETE FROM FII_FIN_CAT_MAPPINGS';
2421:
2422: DELETE FROM FII_FIN_CAT_MAPPINGS
2423: WHERE
2424: (parent_fin_cat_id, child_fin_cat_id) IN
2418: --Copy FII_FIN_CAT_MAPPINGS_GT to FII_FIN_CAT_MAPPINGS
2419:
2420: g_phase := 'DELETE FROM FII_FIN_CAT_MAPPINGS';
2421:
2422: DELETE FROM FII_FIN_CAT_MAPPINGS
2423: WHERE
2424: (parent_fin_cat_id, child_fin_cat_id) IN
2425: (SELECT parent_fin_cat_id, child_fin_cat_id
2426: FROM FII_FIN_CAT_MAPPINGS
2422: DELETE FROM FII_FIN_CAT_MAPPINGS
2423: WHERE
2424: (parent_fin_cat_id, child_fin_cat_id) IN
2425: (SELECT parent_fin_cat_id, child_fin_cat_id
2426: FROM FII_FIN_CAT_MAPPINGS
2427: MINUS
2428: SELECT parent_fin_cat_id, child_fin_cat_id
2429: FROM FII_FIN_CAT_MAPPINGS_GT);
2430:
2425: (SELECT parent_fin_cat_id, child_fin_cat_id
2426: FROM FII_FIN_CAT_MAPPINGS
2427: MINUS
2428: SELECT parent_fin_cat_id, child_fin_cat_id
2429: FROM FII_FIN_CAT_MAPPINGS_GT);
2430:
2431: IF (FIIDIM_Debug) THEN
2432: FII_UTIL.Write_Log('Deleted ' || SQL%ROWCOUNT || ' rows from FII_FIN_CAT_MAPPINGS');
2433: END IF;
2428: SELECT parent_fin_cat_id, child_fin_cat_id
2429: FROM FII_FIN_CAT_MAPPINGS_GT);
2430:
2431: IF (FIIDIM_Debug) THEN
2432: FII_UTIL.Write_Log('Deleted ' || SQL%ROWCOUNT || ' rows from FII_FIN_CAT_MAPPINGS');
2433: END IF;
2434:
2435: g_phase := 'Insert into FII_FIN_CAT_MAPPINGS';
2436:
2431: IF (FIIDIM_Debug) THEN
2432: FII_UTIL.Write_Log('Deleted ' || SQL%ROWCOUNT || ' rows from FII_FIN_CAT_MAPPINGS');
2433: END IF;
2434:
2435: g_phase := 'Insert into FII_FIN_CAT_MAPPINGS';
2436:
2437: Insert into FII_FIN_CAT_MAPPINGS (
2438: parent_fin_cat_id,
2439: child_fin_cat_id,
2433: END IF;
2434:
2435: g_phase := 'Insert into FII_FIN_CAT_MAPPINGS';
2436:
2437: Insert into FII_FIN_CAT_MAPPINGS (
2438: parent_fin_cat_id,
2439: child_fin_cat_id,
2440: creation_date,
2441: created_by,
2448: FII_USER_ID,
2449: SYSDATE,
2450: FII_USER_ID,
2451: FII_LOGIN_ID
2452: FROM FII_FIN_CAT_MAPPINGS_GT
2453: MINUS
2454: SELECT parent_fin_cat_id,
2455: child_fin_cat_id,
2456: SYSDATE,
2457: FII_USER_ID,
2458: SYSDATE,
2459: FII_USER_ID,
2460: FII_LOGIN_ID
2461: FROM FII_FIN_CAT_MAPPINGS);
2462:
2463: IF (FIIDIM_Debug) THEN
2464: FII_UTIL.Write_Log('Inserted ' || SQL%ROWCOUNT || ' rows into FII_FIN_CAT_MAPPINGS');
2465: END IF;
2460: FII_LOGIN_ID
2461: FROM FII_FIN_CAT_MAPPINGS);
2462:
2463: IF (FIIDIM_Debug) THEN
2464: FII_UTIL.Write_Log('Inserted ' || SQL%ROWCOUNT || ' rows into FII_FIN_CAT_MAPPINGS');
2465: END IF;
2466:
2467: --Call FND_STATS to collect statistics after re-populating the table.
2468:
2465: END IF;
2466:
2467: --Call FND_STATS to collect statistics after re-populating the table.
2468:
2469: g_phase := 'gather_table_stats for FII_FIN_CAT_MAPPINGS';
2470:
2471: FND_STATS.gather_table_stats
2472: (ownname => g_schema_name,
2473: tabname => 'FII_FIN_CAT_MAPPINGS');
2469: g_phase := 'gather_table_stats for FII_FIN_CAT_MAPPINGS';
2470:
2471: FND_STATS.gather_table_stats
2472: (ownname => g_schema_name,
2473: tabname => 'FII_FIN_CAT_MAPPINGS');
2474:
2475: -- Bug 4200473. Not to analyze MLOG in incremental run.
2476: -- As per performance teams suggestions.
2477:
2474:
2475: -- Bug 4200473. Not to analyze MLOG in incremental run.
2476: -- As per performance teams suggestions.
2477:
2478: -- g_phase := 'gather_table_stats for MLOG$_FII_FIN_CAT_MAPPINGS';
2479:
2480: -- FND_STATS.gather_table_stats
2481: -- (ownname => g_schema_name,
2482: -- tabname => 'MLOG$_FII_FIN_CAT_MAPPINGS');
2478: -- g_phase := 'gather_table_stats for MLOG$_FII_FIN_CAT_MAPPINGS';
2479:
2480: -- FND_STATS.gather_table_stats
2481: -- (ownname => g_schema_name,
2482: -- tabname => 'MLOG$_FII_FIN_CAT_MAPPINGS');
2483:
2484:
2485: --Call FND_STATS to collect statistics after re-populating the table.
2486: