[Home] [Help]
23: l_tab_name VARCHAR2(240) := NULL;
24:
25: BEGIN
26:
27: --FII_MESSAGE.Func_Ent (func_name => 'Is_Table_Validated');
28:
29: -- Execute statement to determine if the value set is table validated
30: BEGIN
31:
39: WHEN NO_DATA_FOUND THEN
40: return FALSE;
41: END;
42:
43: --FII_MESSAGE.Func_Succ (func_name => 'Is_Table_Validated');
44:
45: RETURN TRUE;
46:
47: EXCEPTION
58:
59: Begin
60:
61: -- if FIIDIM_Debug then
62: -- FII_MESSAGE.Func_Ent (func_name => 'Get_Value_Set_Name');
63: -- end if;
64:
65: select flex_value_set_name into l_vs_name
66: from fnd_flex_value_sets
66: from fnd_flex_value_sets
67: where flex_value_set_id = p_vs_id;
68:
69: -- if FIIDIM_Debug then
70: -- FII_MESSAGE.Func_Succ (func_name => 'Get_Value_Set_Name');
71: -- end if;
72:
73: return l_vs_name;
74:
90:
91: Begin
92:
93: -- if FIIDIM_Debug then
94: -- FII_MESSAGE.Func_Ent (func_name => 'Get_Flex_Value');
95: -- end if;
96:
97: select flex_value into l_flex_value
98: from fnd_flex_values
98: from fnd_flex_values
99: where flex_value_id = p_flex_value_id;
100:
101: -- if FIIDIM_Debug then
102: -- FII_MESSAGE.Func_Succ (func_name => 'Get_Flex_Value');
103: -- end if;
104:
105: return l_flex_value;
106:
265: END IF;
266:
267: --If the master value is not set up, raise an exception
268: IF G_MASTER_VALUE_SET_ID is NULL THEN
269: FII_MESSAGE.write_log (msg_name => 'FII_MSTR_VSET_NOT_FOUND',
270: token_num => 0);
271: FII_MESSAGE.write_output (msg_name => 'FII_MSTR_VSET_NOT_FOUND',
272: token_num => 0);
273: RAISE LOBDIM_fatal_err;
267: --If the master value is not set up, raise an exception
268: IF G_MASTER_VALUE_SET_ID is NULL THEN
269: FII_MESSAGE.write_log (msg_name => 'FII_MSTR_VSET_NOT_FOUND',
270: token_num => 0);
271: FII_MESSAGE.write_output (msg_name => 'FII_MSTR_VSET_NOT_FOUND',
272: token_num => 0);
273: RAISE LOBDIM_fatal_err;
274: --If the top node is not set up, raise an exception
275: ELSIF G_TOP_NODE_ID is NULL OR G_TOP_NODE_VALUE is NULL THEN
272: token_num => 0);
273: RAISE LOBDIM_fatal_err;
274: --If the top node is not set up, raise an exception
275: ELSIF G_TOP_NODE_ID is NULL OR G_TOP_NODE_VALUE is NULL THEN
276: FII_MESSAGE.write_log (msg_name => 'FII_MSTR_TNODE_NOT_FOUND',
277: token_num => 0);
278: FII_MESSAGE.write_output (msg_name => 'FII_MSTR_TNODE_NOT_FOUND',
279: token_num => 0);
280: RAISE LOBDIM_fatal_err;
274: --If the top node is not set up, raise an exception
275: ELSIF G_TOP_NODE_ID is NULL OR G_TOP_NODE_VALUE is NULL THEN
276: FII_MESSAGE.write_log (msg_name => 'FII_MSTR_TNODE_NOT_FOUND',
277: token_num => 0);
278: FII_MESSAGE.write_output (msg_name => 'FII_MSTR_TNODE_NOT_FOUND',
279: token_num => 0);
280: RAISE LOBDIM_fatal_err;
281: END IF;
282:
281: END IF;
282:
283: Exception
284: When NO_DATA_FOUND Then
285: FII_MESSAGE.write_log (msg_name => 'FII_MSTR_VSET_NOT_FOUND',
286: token_num => 0);
287: FII_MESSAGE.write_output (msg_name => 'FII_MSTR_VSET_NOT_FOUND',
288: token_num => 0);
289: RAISE LOBDIM_fatal_err;
283: Exception
284: When NO_DATA_FOUND Then
285: FII_MESSAGE.write_log (msg_name => 'FII_MSTR_VSET_NOT_FOUND',
286: token_num => 0);
287: FII_MESSAGE.write_output (msg_name => 'FII_MSTR_VSET_NOT_FOUND',
288: token_num => 0);
289: RAISE LOBDIM_fatal_err;
290: When TOO_MANY_ROWS Then
291: FII_UTIL.Write_Log ('More than one master value set found for LOB Dimension');
311: -- Check if the master value set is a table validated set.
312: g_phase := 'Check if the master value set is a table validated set';
313:
314: If Is_Table_Validated (G_MASTER_VALUE_SET_ID) Then
315: FII_MESSAGE.write_log (msg_name => 'FII_TBL_VALIDATED_VSET',
316: token_num => 1,
317: t1 => 'VS_NAME',
318: v1 => Get_Value_Set_Name (G_MASTER_VALUE_SET_ID));
319: FII_MESSAGE.write_output (msg_name => 'FII_TBL_VALIDATED_VSET',
315: FII_MESSAGE.write_log (msg_name => 'FII_TBL_VALIDATED_VSET',
316: token_num => 1,
317: t1 => 'VS_NAME',
318: v1 => Get_Value_Set_Name (G_MASTER_VALUE_SET_ID));
319: FII_MESSAGE.write_output (msg_name => 'FII_TBL_VALIDATED_VSET',
320: token_num => 1,
321: t1 => 'VS_NAME',
322: v1 => Get_Value_Set_Name (G_MASTER_VALUE_SET_ID));
323: RAISE LOBDIM_fatal_err;
337: When LOBDIM_fatal_err then
338: FII_UTIL.Write_Log ('FII_LOB_MAINTAIN_PKG.Initialize : '|| 'User defined error');
339: FII_UTIL.Write_Log ( 'G_PHASE: ' || G_PHASE);
340: FND_CONCURRENT.Af_Rollback;
341: FII_MESSAGE.Func_Fail(func_name => 'FII_LOB_MAINTAIN_PKG.Initialize');
342: raise;
343:
344: When others then
345: FII_UTIL.Write_Log ('Unexpected error when calling Initialize...');
374:
375: BEGIN
376:
377: IF (FIIDIM_Debug) THEN
378: FII_MESSAGE.Func_Ent ('FII_LOB_MAINTAIN_PKG.Get_NORM_HIERARCHY_TMP');
379: END IF;
380:
381: --First, insert records for the master value set
382: g_phase := 'insert records for the master value set';
448: l_vset_id := vset_rec.child_flex_value_set_id;
449:
450: -- Check if the (child) value set is a table validated set.
451: If Is_Table_Validated (l_vset_id) Then
452: FII_MESSAGE.write_log (msg_name => 'FII_TBL_VALIDATED_VSET',
453: token_num => 1,
454: t1 => 'VS_NAME',
455: v1 => Get_Value_Set_Name (l_vset_id));
456: FII_MESSAGE.write_output (msg_name => 'FII_TBL_VALIDATED_VSET',
452: FII_MESSAGE.write_log (msg_name => 'FII_TBL_VALIDATED_VSET',
453: token_num => 1,
454: t1 => 'VS_NAME',
455: v1 => Get_Value_Set_Name (l_vset_id));
456: FII_MESSAGE.write_output (msg_name => 'FII_TBL_VALIDATED_VSET',
457: token_num => 1,
458: t1 => 'VS_NAME',
459: v1 => Get_Value_Set_Name (l_vset_id));
460: RAISE LOBDIM_fatal_err;
483:
484: END IF;
485:
486: IF (FIIDIM_Debug) THEN
487: FII_MESSAGE.Func_Succ ('FII_LOB_MAINTAIN_PKG.Get_NORM_HIERARCHY_TMP');
488: END IF;
489:
490: Exception
491:
493: FII_UTIL.Write_Log ('FII_LOB_MAINTAIN_PKG.Get_NORM_HIERARCHY_TMP: '||
494: 'User defined error');
495: FII_UTIL.Write_Log ( 'G_PHASE: ' || G_PHASE);
496: FND_CONCURRENT.Af_Rollback;
497: FII_MESSAGE.Func_Fail(func_name => 'FII_LOB_MAINTAIN_PKG.Get_NORM_HIERARCHY_TMP');
498: raise;
499:
500: When others then
501: FII_UTIL.Write_Log ('Unexpected error when calling Get_NORM_HIERARCHY_TMP.');
543:
544: BEGIN
545:
546: IF (FIIDIM_Debug) THEN
547: FII_MESSAGE.Func_Ent ('FII_LOB_MAINTAIN_PKG.Detect_Diamond_Shape');
548: END IF;
549:
550: -- check whole TMP hierarhy table: if there is a diamond
551: -- report and raise an exception
555:
556: l_count := l_count + 1;
557: if l_count = 1 then
558:
559: FII_MESSAGE.write_log(msg_name => 'FII_DMND_SHAPE_VS_EXIST',
560: token_num => 0);
561: FII_MESSAGE.write_log(msg_name => 'FII_REFER_TO_OUTPUT',
562: token_num => 0);
563:
557: if l_count = 1 then
558:
559: FII_MESSAGE.write_log(msg_name => 'FII_DMND_SHAPE_VS_EXIST',
560: token_num => 0);
561: FII_MESSAGE.write_log(msg_name => 'FII_REFER_TO_OUTPUT',
562: token_num => 0);
563:
564: FII_MESSAGE.write_output (msg_name => 'FII_DMND_SHAPE_VS_EXIST',
565: token_num => 0);
560: token_num => 0);
561: FII_MESSAGE.write_log(msg_name => 'FII_REFER_TO_OUTPUT',
562: token_num => 0);
563:
564: FII_MESSAGE.write_output (msg_name => 'FII_DMND_SHAPE_VS_EXIST',
565: token_num => 0);
566: FII_MESSAGE.write_output (msg_name => 'FII_DMND_SHAPE_VS_TAB',
567: token_num => 0);
568:
562: token_num => 0);
563:
564: FII_MESSAGE.write_output (msg_name => 'FII_DMND_SHAPE_VS_EXIST',
565: token_num => 0);
566: FII_MESSAGE.write_output (msg_name => 'FII_DMND_SHAPE_VS_TAB',
567: token_num => 0);
568:
569: end if;
570:
585:
586: END LOOP;
587:
588: IF (FIIDIM_Debug) THEN
589: FII_MESSAGE.Func_Succ ('FII_LOB_MAINTAIN_PKG.Detect_Diamond_Shape');
590: END IF;
591:
592: IF l_count > 0 THEN
593: RAISE LOBDIM_MULT_PAR_err;
630:
631: BEGIN
632:
633: -- IF (FIIDIM_Debug) THEN
634: -- FII_MESSAGE.Func_Ent ('FII_COM_MAINTAIN_PKG.INSERT_IMM_CHILD_NODES');
635: -- END IF;
636:
637: select flex_value_id into l_flex_value_id
638: from fnd_flex_values
702:
703: EXCEPTION
704: WHEN NO_DATA_FOUND Then
705: FII_UTIL.Write_Log ('Insert Immediate child: No Data Found');
706: FII_MESSAGE.Func_Fail
707: (func_name => 'FII_LOB_MAINTAIN_PKG.Insert_Imm_Child_Nodes');
708: RAISE;
709:
710: WHEN OTHERS Then
708: RAISE;
709:
710: WHEN OTHERS Then
711: FII_UTIL.Write_Log (substr(SQLERRM,1,180));
712: FII_MESSAGE.Func_Fail
713: (func_name => 'FII_LOB_MAINTAIN_PKG.INSERT_IMM_CHILD_NODES');
714: RAISE;
715:
716: END INSERT_IMM_CHILD_NODES;
727:
728: BEGIN
729:
730: IF (FIIDIM_Debug) THEN
731: FII_MESSAGE.Func_Ent(func_name => 'FII_LOB_MAINTAIN_PKG.'||
732: 'Flatten_LOB_Dim_Hier');
733: END IF;
734:
735: g_phase := 'Truncate table FII_LOB_HIER_GT';
1008: -- and next_level_is_leaf = 'Y';
1009:
1010:
1011: IF (FIIDIM_Debug) THEN
1012: FII_MESSAGE.Func_Succ(func_name => 'FII_LOB_MAINTAIN_PKG.'||
1013: 'Flatten_LOB_Dim_Hier');
1014: END IF;
1015:
1016: EXCEPTION
1016: EXCEPTION
1017:
1018: WHEN NO_DATA_FOUND THEN
1019: FII_UTIL.Write_Log ('Flatten_LOB_Dim_Hier: No Data Found');
1020: FII_MESSAGE.Func_Fail(func_name => 'FII_LOB_MAINTAIN_PKG.'||
1021: 'Flatten_LOB_Dim_Hier');
1022: FII_UTIL.Write_Log ( 'G_PHASE: ' || G_PHASE);
1023: raise;
1024:
1023: raise;
1024:
1025: WhEN LOBDIM_MULT_PAR_err THEN
1026: FII_UTIL.Write_Log ('Flatten_LOB_Dim_Hier: Diamond Shape Detected');
1027: FII_MESSAGE.Func_Fail (func_name =>
1028: 'FII_DIMENSION_MAINTAIN_PKG.Flatten_LOB_Dim_Hier');
1029: FII_UTIL.Write_Log ( 'G_PHASE: ' || G_PHASE);
1030: raise;
1031:
1030: raise;
1031:
1032: WHEN OTHERS THEN
1033: FII_UTIL.Write_Log ('Flatten_LOB_Dim_Hier: '|| substr(sqlerrm,1,180));
1034: FII_MESSAGE.Func_Fail(func_name => 'FII_LOB_MAINTAIN_PKG.'||
1035: 'Flatten_LOB_Dim_Hier');
1036: FII_UTIL.Write_Log ( 'G_PHASE: ' || G_PHASE);
1037: raise;
1038:
1048:
1049: BEGIN
1050:
1051: IF (FIIDIM_Debug) THEN
1052: FII_MESSAGE.Func_Ent(func_name => 'FII_LOB_MAINTAIN_PKG.'||'Get_Sort_Order');
1053: END IF;
1054:
1055: g_phase := 'Update next_level_lob_sort_order for fii_lob_hier_gt ';
1056:
1066: FII_UTIL.Write_Log('Updated ' || SQL%ROWCOUNT || ' rows in fii_lob_hier_gt');
1067: END IF;
1068:
1069: IF (FIIDIM_Debug) THEN
1070: FII_MESSAGE.Func_Succ(func_name=>'FII_LOB_MAINTAIN_PKG.'||'Get_Sort_Order');
1071: END IF;
1072:
1073: EXCEPTION
1074:
1074:
1075: WHEN OTHERS THEN
1076: FII_UTIL.Write_Log ('Get_Sort_Order -> phase: '|| g_phase);
1077: FII_UTIL.Write_Log ('Get_Sort_Order: '|| substr(sqlerrm,1,180));
1078: FII_MESSAGE.Func_Fail(func_name => 'FII_LOB_MAINTAIN_PKG.'||'Get_Sort_Order');
1079: raise;
1080:
1081: END Get_Sort_Order;
1082:
1089:
1090: Begin
1091:
1092: IF (FIIDIM_Debug) THEN
1093: FII_MESSAGE.Func_Ent(func_name => 'FII_LOB_MAINTAIN_PKG.'||
1094: 'Get_Pruned_LOB_GT');
1095: END IF;
1096:
1097: --Delete from FII_LOB_HIER_GT for child value set not equal to
1162: End if;
1163: --------------------------------------------------------------
1164:
1165: IF (FIIDIM_Debug) THEN
1166: FII_MESSAGE.Func_Succ(func_name => 'FII_LOB_MAINTAIN_PKG.'||
1167: 'Get_Pruned_LOB_GT');
1168: END IF;
1169:
1170: EXCEPTION
1171:
1172: WHEN OTHERS THEN
1173: FII_UTIL.Write_Log ('Get_Pruned_LOB_GT -> phase: '|| g_phase);
1174: FII_UTIL.Write_Log ('Get_Pruned_LOB_GT: '|| substr(sqlerrm,1,180));
1175: FII_MESSAGE.Func_Fail(func_name => 'FII_LOB_MAINTAIN_PKG.'||
1176: 'Get_Pruned_LOB_GT');
1177: raise;
1178:
1179: END Get_Pruned_LOB_GT;
1186:
1187: Begin
1188:
1189: IF (FIIDIM_Debug) THEN
1190: FII_MESSAGE.Func_Ent(func_name => 'FII_LOB_MAINTAIN_PKG.'||
1191: 'Handle_Unenabled_DIM');
1192: END IF;
1193:
1194: g_phase := 'Truncate tables';
1276:
1277: commit;
1278:
1279: IF (FIIDIM_Debug) THEN
1280: FII_MESSAGE.Func_Succ(func_name => 'FII_LOB_MAINTAIN_PKG.'||
1281: 'Handle_Unenabled_DIM');
1282: END IF;
1283:
1284: EXCEPTION
1285:
1286: WHEN OTHERS THEN
1287: FII_UTIL.Write_Log ('Handle_Unenabled_DIM -> phase: '|| g_phase);
1288: FII_UTIL.Write_Log ('Handle_Unenabled_DIM: '|| substr(sqlerrm,1,180));
1289: FII_MESSAGE.Func_Fail(func_name => 'FII_LOB_MAINTAIN_PKG.'||
1290: 'Handle_Unenabled_DIM');
1291: raise;
1292:
1293: END Handle_Unenabled_DIM;
1303:
1304: BEGIN
1305:
1306: IF (FIIDIM_Debug) THEN
1307: FII_MESSAGE.Func_Ent(func_name => 'FII_LOB_MAINTAIN_PKG.Init_Load');
1308: END IF;
1309:
1310: --First do the initialization
1311:
1441:
1442: FND_CONCURRENT.Af_Commit;
1443:
1444: IF (FIIDIM_Debug) THEN
1445: FII_MESSAGE.Func_Succ(func_name => 'FII_LOB_MAINTAIN_PKG.Init_Load');
1446: END IF;
1447:
1448: -- ret_val := FND_CONCURRENT.Set_Completion_Status
1449: -- (status => 'NORMAL', message => NULL);
1457: FII_UTIL.Write_Log ('FII_LOB_MAINTAIN_PKG.Init_Load: '||
1458: 'User defined error');
1459: -- Rollback
1460: FND_CONCURRENT.Af_Rollback;
1461: FII_MESSAGE.Func_Fail(func_name => 'FII_LOB_MAINTAIN_PKG.Init_Load');
1462: retcode := sqlcode;
1463: ret_val := FND_CONCURRENT.Set_Completion_Status
1464: (status => 'ERROR', message => substr(sqlerrm,1,180));
1465:
1468: FII_UTIL.Write_Log ('FII_LOB_MAINTAIN_PKG.Init_Load: '||
1469: 'Diamond Shape Detected');
1470: -- Rollback
1471: FND_CONCURRENT.Af_Rollback;
1472: FII_MESSAGE.Func_Fail(func_name => 'FII_LOB_MAINTAIN_PKG.Init_Load');
1473: retcode := sqlcode;
1474: ret_val := FND_CONCURRENT.Set_Completion_Status
1475: (status => 'ERROR', message => substr(sqlerrm,1,180));
1476:
1490: 'Other error in FII_LOB_MAINTAIN_PKG.Init_Load: ' || substr(sqlerrm,1,180));
1491:
1492: -- Rollback
1493: FND_CONCURRENT.Af_Rollback;
1494: FII_MESSAGE.Func_Fail(func_name => 'II_LOB_MAINTAIN_PKG.Init_Load');
1495: retcode := sqlcode;
1496: ret_val := FND_CONCURRENT.Set_Completion_Status
1497: (status => 'ERROR', message => substr(sqlerrm,1,180));
1498:
1519: END IF;
1520: -----------------------------------------------------------------------------
1521:
1522: IF (FIIDIM_Debug) THEN
1523: FII_MESSAGE.Func_Ent(func_name => 'FII_LOB_MAINTAIN_PKG.Incre_Load');
1524: END IF;
1525:
1526: --First do the initialization
1527:
1752:
1753: FND_CONCURRENT.Af_Commit;
1754:
1755: IF (FIIDIM_Debug) THEN
1756: FII_MESSAGE.Func_Succ(func_name => 'FII_LOB_MAINTAIN_PKG.Incre_Load');
1757: END IF;
1758:
1759: -- ret_val := FND_CONCURRENT.Set_Completion_Status
1760: -- (status => 'COMPLETE', message => NULL);
1767: FII_UTIL.Write_Log ('FII_LOB_MAINTAIN_PKG.Incre_Update'||
1768: 'User defined error');
1769: -- Rollback
1770: FND_CONCURRENT.Af_Rollback;
1771: FII_MESSAGE.Func_Fail(func_name => 'FII_LOB_MAINTAIN_PKG.Incre_Update');
1772: retcode := sqlcode;
1773: ret_val := FND_CONCURRENT.Set_Completion_Status
1774: (status => 'ERROR', message => substr(sqlerrm,1,180));
1775:
1778: FII_UTIL.Write_Log ('FII_LOB_MAINTAIN_PKG.Incre_Update: '||
1779: 'Diamond Shape Detected');
1780: -- Rollback
1781: FND_CONCURRENT.Af_Rollback;
1782: FII_MESSAGE.Func_Fail(func_name => 'FII_LOB_MAINTAIN_PKG.Incre_Update');
1783: retcode := sqlcode;
1784: ret_val := FND_CONCURRENT.Set_Completion_Status
1785: (status => 'ERROR', message => substr(sqlerrm,1,180));
1786:
1800: 'Other error in FII_LOB_MAINTAIN_PKG.Incre_Update: ' || substr(sqlerrm,1,180));
1801:
1802: -- Rollback
1803: FND_CONCURRENT.Af_Rollback;
1804: FII_MESSAGE.Func_Fail(func_name => 'II_LOB_MAINTAIN_PKG.Incre_Update');
1805: retcode := sqlcode;
1806: ret_val := FND_CONCURRENT.Set_Completion_Status
1807: (status => 'ERROR', message => substr(sqlerrm,1,180));
1808: