17: p_sequence_no in number
18: ) is
19: begin -- [
20: hr_utility.set_location('gbstrdbi.insert_route_context_usages', 1);
21: insert into ff_route_context_usages
22: (route_id,
23: context_id,
24: sequence_no)
25: select ff_routes_s.currval,
365: PROCEDURE create_archive_route is
366:
367: cursor c_check_context(p_route_id number, p_context_id number) is
368: select 'Y'
369: from ff_route_context_usages frcu
370: where route_id = p_route_id
371: and context_id = p_context_id;
372:
373: l_text long;
431: update ff_routes
432: set text = l_text
433: where route_id = l_route_id;
434:
435: hr_utility.trace('deleting ff_route_context_usages for EMPLOYER_ARCHIVE');
436:
437: /* delete ff_route_context_usages
438: where route_id = l_route_id; */
439:
433: where route_id = l_route_id;
434:
435: hr_utility.trace('deleting ff_route_context_usages for EMPLOYER_ARCHIVE');
436:
437: /* delete ff_route_context_usages
438: where route_id = l_route_id; */
439:
440: open c_check_context(l_route_id,l_tax_unit_context_id);
441: fetch c_check_context into l_exists;
440: open c_check_context(l_route_id,l_tax_unit_context_id);
441: fetch c_check_context into l_exists;
442: if c_check_context%NOTFOUND then
443:
444: hr_utility.trace('inserting ff_route_context_usages for EMPLOYER_ARCHIVE');
445:
446: insert into ff_route_context_usages
447: (route_id,
448: context_id,
442: if c_check_context%NOTFOUND then
443:
444: hr_utility.trace('inserting ff_route_context_usages for EMPLOYER_ARCHIVE');
445:
446: insert into ff_route_context_usages
447: (route_id,
448: context_id,
449: sequence_no)
450: values (l_route_id,
450: values (l_route_id,
451: l_payroll_action_context_id,
452: 1);
453:
454: hr_utility.trace('inserting ff_route_context_usages for EMPLOYER_ARCHIVE');
455:
456: insert into ff_route_context_usages
457: (route_id,
458: context_id,
452: 1);
453:
454: hr_utility.trace('inserting ff_route_context_usages for EMPLOYER_ARCHIVE');
455:
456: insert into ff_route_context_usages
457: (route_id,
458: context_id,
459: sequence_no)
460: values (l_route_id,
505: 1 from dual;
506:
507: -- define the route_context usage
508:
509: hr_utility.trace('inserting ff_route_context_usages for EMPLOYER_ARCHIVE');
510:
511: insert into ff_route_context_usages
512: (route_id,
513: context_id,
507: -- define the route_context usage
508:
509: hr_utility.trace('inserting ff_route_context_usages for EMPLOYER_ARCHIVE');
510:
511: insert into ff_route_context_usages
512: (route_id,
513: context_id,
514: sequence_no)
515: select ff_routes_s.currval,
516: l_payroll_action_context_id,
517: 1
518: from dual;
519:
520: hr_utility.trace('inserting ff_route_context_usages for EMPLOYER_ARCHIVE');
521:
522: insert into ff_route_context_usages
523: (route_id,
524: context_id,
518: from dual;
519:
520: hr_utility.trace('inserting ff_route_context_usages for EMPLOYER_ARCHIVE');
521:
522: insert into ff_route_context_usages
523: (route_id,
524: context_id,
525: sequence_no)
526: select ff_routes_s.currval,
552: update ff_routes
553: set text = l_text
554: where route_id = l_route_id;
555:
556: /* delete ff_route_context_usages
557: where route_id = l_route_id; */
558:
559: open c_check_context(l_route_id,l_tax_unit_context_id);
560: fetch c_check_context into l_exists;
559: open c_check_context(l_route_id,l_tax_unit_context_id);
560: fetch c_check_context into l_exists;
561: if c_check_context%NOTFOUND then
562:
563: insert into ff_route_context_usages
564: (route_id,
565: context_id,
566: sequence_no)
567: values (l_route_id,
567: values (l_route_id,
568: l_payroll_action_context_id,
569: 1);
570:
571: insert into ff_route_context_usages
572: (route_id,
573: context_id,
574: sequence_no)
575: values (l_route_id,
618: 1 from dual;
619:
620: -- define the route_context usage
621:
622: insert into ff_route_context_usages
623: (route_id,
624: context_id,
625: sequence_no)
626: select ff_routes_s.currval,
627: l_payroll_action_context_id,
628: 1
629: from dual;
630:
631: insert into ff_route_context_usages
632: (route_id,
633: context_id,
634: sequence_no)
635: select ff_routes_s.currval,
661: update ff_routes
662: set text = l_text
663: where route_id = l_route_id;
664:
665: /* delete ff_route_context_usages
666: where route_id = l_route_id; */
667:
668: open c_check_context(l_route_id,l_tax_unit_context_id);
669: fetch c_check_context into l_exists;
669: fetch c_check_context into l_exists;
670: if c_check_context%NOTFOUND then
671:
672:
673: insert into ff_route_context_usages
674: (route_id,
675: context_id,
676: sequence_no)
677: values ( l_route_id,
677: values ( l_route_id,
678: l_payroll_action_context_id,
679: 1);
680:
681: insert into ff_route_context_usages
682: (route_id,
683: context_id,
684: sequence_no)
685: values (l_route_id,
729: 1 from dual;
730:
731: -- define the route_context usage
732:
733: insert into ff_route_context_usages
734: (route_id,
735: context_id,
736: sequence_no)
737: select ff_routes_s.currval,
738: l_payroll_action_context_id,
739: 1
740: from dual;
741:
742: insert into ff_route_context_usages
743: (route_id,
744: context_id,
745: sequence_no)
746: select ff_routes_s.currval,
788: where route_id = l_route_id;
789:
790: hr_utility.trace('deleting ff_routes for EMPLOYER_TAX_UNIT_ARCHIVE_DATE');
791:
792: /* delete ff_route_context_usages
793: where route_id = l_route_id; */
794:
795: open c_check_context(l_route_id,l_tax_unit_context_id);
796: fetch c_check_context into l_exists;
795: open c_check_context(l_route_id,l_tax_unit_context_id);
796: fetch c_check_context into l_exists;
797: if c_check_context%NOTFOUND then
798:
799: insert into ff_route_context_usages
800: (route_id,
801: context_id,
802: sequence_no)
803: values (l_route_id,
803: values (l_route_id,
804: l_payroll_action_context_id,
805: 1);
806:
807: insert into ff_route_context_usages
808: (route_id,
809: context_id,
810: sequence_no)
811: values (l_route_id,
851: 1 from dual;
852:
853: -- define the route_context usage
854:
855: insert into ff_route_context_usages
856: (route_id,
857: context_id,
858: sequence_no)
859: select ff_routes_s.currval,
860: l_payroll_action_context_id,
861: 1
862: from dual;
863:
864: insert into ff_route_context_usages
865: (route_id,
866: context_id,
867: sequence_no)
868: select ff_routes_s.currval,
910: update ff_routes
911: set text = l_text
912: where route_id = l_route_id;
913:
914: hr_utility.trace('deleting ff_route_context_usages for EMPLOYER_TAX_UNIT_ARCHIVE_NUMBER');
915:
916: /* delete ff_route_context_usages
917: where route_id = l_route_id; */
918:
912: where route_id = l_route_id;
913:
914: hr_utility.trace('deleting ff_route_context_usages for EMPLOYER_TAX_UNIT_ARCHIVE_NUMBER');
915:
916: /* delete ff_route_context_usages
917: where route_id = l_route_id; */
918:
919: open c_check_context(l_route_id,l_tax_unit_context_id);
920: fetch c_check_context into l_exists;
920: fetch c_check_context into l_exists;
921: if c_check_context%NOTFOUND then
922:
923:
924: hr_utility.trace('inserting ff_route_context_usages for EMPLOYER_TAX_UNIT_ARCHIVE_NUMBER');
925:
926: insert into ff_route_context_usages
927: (route_id,
928: context_id,
922:
923:
924: hr_utility.trace('inserting ff_route_context_usages for EMPLOYER_TAX_UNIT_ARCHIVE_NUMBER');
925:
926: insert into ff_route_context_usages
927: (route_id,
928: context_id,
929: sequence_no)
930: values (l_route_id,
930: values (l_route_id,
931: l_payroll_action_context_id,
932: 1);
933:
934: hr_utility.trace('inserting ff_route_context_usages for EMPLOYER_TAX_UNIT_ARCHIVE_NUMBER');
935:
936: insert into ff_route_context_usages
937: (route_id,
938: context_id,
932: 1);
933:
934: hr_utility.trace('inserting ff_route_context_usages for EMPLOYER_TAX_UNIT_ARCHIVE_NUMBER');
935:
936: insert into ff_route_context_usages
937: (route_id,
938: context_id,
939: sequence_no)
940: values (l_route_id,
983: 1 from dual;
984:
985: -- define the route_context usage
986:
987: insert into ff_route_context_usages
988: (route_id,
989: context_id,
990: sequence_no)
991: select ff_routes_s.currval,
992: l_payroll_action_context_id,
993: 1
994: from dual;
995:
996: insert into ff_route_context_usages
997: (route_id,
998: context_id,
999: sequence_no)
1000: select ff_routes_s.currval,
1040: update ff_routes
1041: set text = l_text
1042: where route_id = l_route_id;
1043:
1044: hr_utility.trace('deleting ff_route_context_usages for EMPLOYER_TAX_UNIT_ARCHIVE');
1045:
1046: /* delete ff_route_context_usages
1047: where route_id = l_route_id; */
1048:
1042: where route_id = l_route_id;
1043:
1044: hr_utility.trace('deleting ff_route_context_usages for EMPLOYER_TAX_UNIT_ARCHIVE');
1045:
1046: /* delete ff_route_context_usages
1047: where route_id = l_route_id; */
1048:
1049: hr_utility.trace('inserting ff_route_context_usages for EMPLOYER_TAX_UNIT_ARCHIVE');
1050: open c_check_context(l_route_id,l_tax_unit_context_id);
1045:
1046: /* delete ff_route_context_usages
1047: where route_id = l_route_id; */
1048:
1049: hr_utility.trace('inserting ff_route_context_usages for EMPLOYER_TAX_UNIT_ARCHIVE');
1050: open c_check_context(l_route_id,l_tax_unit_context_id);
1051: fetch c_check_context into l_exists;
1052: if c_check_context%NOTFOUND then
1053:
1051: fetch c_check_context into l_exists;
1052: if c_check_context%NOTFOUND then
1053:
1054:
1055: insert into ff_route_context_usages
1056: (route_id,
1057: context_id,
1058: sequence_no)
1059: values (l_route_id,
1059: values (l_route_id,
1060: l_payroll_action_context_id,
1061: 1);
1062:
1063: hr_utility.trace('inserting ff_route_context_usages for EMPLOYER_TAX_UNIT_ARCHIVE');
1064:
1065: insert into ff_route_context_usages
1066: (route_id,
1067: context_id,
1061: 1);
1062:
1063: hr_utility.trace('inserting ff_route_context_usages for EMPLOYER_TAX_UNIT_ARCHIVE');
1064:
1065: insert into ff_route_context_usages
1066: (route_id,
1067: context_id,
1068: sequence_no)
1069: values (l_route_id,
1110: 1 from dual;
1111:
1112: -- define the route_context usage
1113:
1114: insert into ff_route_context_usages
1115: (route_id,
1116: context_id,
1117: sequence_no)
1118: select ff_routes_s.currval,
1119: l_payroll_action_context_id,
1120: 1
1121: from dual;
1122:
1123: insert into ff_route_context_usages
1124: (route_id,
1125: context_id,
1126: sequence_no)
1127: select ff_routes_s.currval,
1169: update ff_routes
1170: set text = l_text
1171: where route_id = l_route_id;
1172:
1173: /* delete ff_route_context_usages
1174: where route_id = l_route_id; */
1175:
1176: open c_check_context(l_route_id,l_tax_unit_context_id);
1177: fetch c_check_context into l_exists;
1177: fetch c_check_context into l_exists;
1178: if c_check_context%NOTFOUND then
1179:
1180:
1181: insert into ff_route_context_usages
1182: (route_id,
1183: context_id,
1184: sequence_no)
1185: values (l_route_id,
1185: values (l_route_id,
1186: l_payroll_action_context_id,
1187: 1);
1188:
1189: insert into ff_route_context_usages
1190: (route_id,
1191: context_id,
1192: sequence_no)
1193: values (l_route_id,
1193: values (l_route_id,
1194: l_tax_unit_context_id,
1195: 2);
1196:
1197: insert into ff_route_context_usages
1198: (route_id,
1199: context_id,
1200: sequence_no)
1201: values (l_route_id,
1242: 1 from dual;
1243:
1244: -- define the route_context usage
1245:
1246: insert into ff_route_context_usages
1247: (route_id,
1248: context_id,
1249: sequence_no)
1250: select ff_routes_s.currval,
1251: l_payroll_action_context_id,
1252: 1
1253: from dual;
1254:
1255: insert into ff_route_context_usages
1256: (route_id,
1257: context_id,
1258: sequence_no)
1259: select ff_routes_s.currval,
1260: l_tax_unit_context_id,
1261: 2
1262: from dual;
1263:
1264: insert into ff_route_context_usages
1265: (route_id,
1266: context_id,
1267: sequence_no)
1268: select ff_routes_s.currval,
1309: update ff_routes
1310: set text = l_text
1311: where route_id = l_route_id;
1312:
1313: /* delete ff_route_context_usages
1314: where route_id = l_route_id; */
1315:
1316: open c_check_context(l_route_id,l_tax_unit_context_id);
1317: fetch c_check_context into l_exists;
1317: fetch c_check_context into l_exists;
1318: if c_check_context%NOTFOUND then
1319:
1320:
1321: insert into ff_route_context_usages
1322: (route_id,
1323: context_id,
1324: sequence_no)
1325: values (l_route_id,
1325: values (l_route_id,
1326: l_payroll_action_context_id,
1327: 1);
1328:
1329: insert into ff_route_context_usages
1330: (route_id,
1331: context_id,
1332: sequence_no)
1333: values (l_route_id,
1333: values (l_route_id,
1334: l_tax_unit_context_id,
1335: 2);
1336:
1337: insert into ff_route_context_usages
1338: (route_id,
1339: context_id,
1340: sequence_no)
1341: values (l_route_id,
1382: 1 from dual;
1383:
1384: -- define the route_context usage
1385:
1386: insert into ff_route_context_usages
1387: (route_id,
1388: context_id,
1389: sequence_no)
1390: select ff_routes_s.currval,
1391: l_payroll_action_context_id,
1392: 1
1393: from dual;
1394:
1395: insert into ff_route_context_usages
1396: (route_id,
1397: context_id,
1398: sequence_no)
1399: select ff_routes_s.currval,
1400: l_tax_unit_context_id,
1401: 2
1402: from dual;
1403:
1404: insert into ff_route_context_usages
1405: (route_id,
1406: context_id,
1407: sequence_no)
1408: select ff_routes_s.currval,
1449: update ff_routes
1450: set text = l_text
1451: where route_id = l_route_id;
1452:
1453: /* delete ff_route_context_usages
1454: where route_id = l_route_id; */
1455:
1456: open c_check_context(l_route_id,l_tax_unit_context_id);
1457: fetch c_check_context into l_exists;
1457: fetch c_check_context into l_exists;
1458: if c_check_context%NOTFOUND then
1459:
1460:
1461: insert into ff_route_context_usages
1462: (route_id,
1463: context_id,
1464: sequence_no)
1465: values (l_route_id,
1465: values (l_route_id,
1466: l_payroll_action_context_id,
1467: 1);
1468:
1469: insert into ff_route_context_usages
1470: (route_id,
1471: context_id,
1472: sequence_no)
1473: values (l_route_id,
1473: values (l_route_id,
1474: l_tax_unit_context_id,
1475: 2);
1476:
1477: insert into ff_route_context_usages
1478: (route_id,
1479: context_id,
1480: sequence_no)
1481: values (l_route_id,
1522: 1 from dual;
1523:
1524: -- define the route_context usage
1525:
1526: insert into ff_route_context_usages
1527: (route_id,
1528: context_id,
1529: sequence_no)
1530: select ff_routes_s.currval,
1531: l_payroll_action_context_id,
1532: 1
1533: from dual;
1534:
1535: insert into ff_route_context_usages
1536: (route_id,
1537: context_id,
1538: sequence_no)
1539: select ff_routes_s.currval,
1540: l_tax_unit_context_id,
1541: 2
1542: from dual;
1543:
1544: insert into ff_route_context_usages
1545: (route_id,
1546: context_id,
1547: sequence_no)
1548: select ff_routes_s.currval,
1606: 1 from dual;
1607:
1608: -- define the route_context usage
1609:
1610: insert into ff_route_context_usages
1611: (route_id,
1612: context_id,
1613: sequence_no)
1614: select ff_routes_s.currval,
1673: 1 from dual;
1674:
1675: -- define the route_context usage
1676:
1677: insert into ff_route_context_usages
1678: (route_id,
1679: context_id,
1680: sequence_no)
1681: select ff_routes_s.currval,
1739: 1 from dual;
1740:
1741: -- define the route_context usage
1742:
1743: insert into ff_route_context_usages
1744: (route_id,
1745: context_id,
1746: sequence_no)
1747: select ff_routes_s.currval,
1816: 1);
1817:
1818: -- define the route_context usage
1819:
1820: insert into ff_route_context_usages
1821: (route_id,
1822: context_id,
1823: sequence_no)
1824: values (ff_routes_s.currval,
1824: values (ff_routes_s.currval,
1825: l_assignment_action_context_id,
1826: 1);
1827:
1828: insert into ff_route_context_usages
1829: (route_id,
1830: context_id,
1831: sequence_no)
1832: values (ff_routes_s.currval,
1902: 1);
1903:
1904: -- define the route_context usage
1905:
1906: insert into ff_route_context_usages
1907: (route_id,
1908: context_id,
1909: sequence_no)
1910: values (ff_routes_s.currval,
1910: values (ff_routes_s.currval,
1911: l_assignment_action_context_id,
1912: 1);
1913:
1914: insert into ff_route_context_usages
1915: (route_id,
1916: context_id,
1917: sequence_no)
1918: values (ff_routes_s.currval,
1995: 1);
1996:
1997: -- define the route_context usage
1998:
1999: insert into ff_route_context_usages
2000: (route_id,
2001: context_id,
2002: sequence_no)
2003: values (ff_routes_s.currval,
2003: values (ff_routes_s.currval,
2004: l_assignment_action_context_id,
2005: 1);
2006:
2007: insert into ff_route_context_usages
2008: (route_id,
2009: context_id,
2010: sequence_no)
2011: values (ff_routes_s.currval,
2011: values (ff_routes_s.currval,
2012: l_tax_unit_context_id,
2013: 2);
2014:
2015: insert into ff_route_context_usages
2016: (route_id,
2017: context_id,
2018: sequence_no)
2019: values (ff_routes_s.currval,
2096: 1);
2097:
2098: -- define the route_context usage
2099:
2100: insert into ff_route_context_usages
2101: (route_id,
2102: context_id,
2103: sequence_no)
2104: values (ff_routes_s.currval,
2104: values (ff_routes_s.currval,
2105: l_assignment_action_context_id,
2106: 1);
2107:
2108: insert into ff_route_context_usages
2109: (route_id,
2110: context_id,
2111: sequence_no)
2112: values (ff_routes_s.currval,
2112: values (ff_routes_s.currval,
2113: l_tax_unit_context_id,
2114: 2);
2115:
2116: insert into ff_route_context_usages
2117: (route_id,
2118: context_id,
2119: sequence_no)
2120: values (ff_routes_s.currval,
2196: 1);
2197:
2198: -- define the route_context usage
2199:
2200: insert into ff_route_context_usages
2201: (route_id,
2202: context_id,
2203: sequence_no)
2204: values (ff_routes_s.currval,
2204: values (ff_routes_s.currval,
2205: l_assignment_action_context_id,
2206: 1);
2207:
2208: insert into ff_route_context_usages
2209: (route_id,
2210: context_id,
2211: sequence_no)
2212: values (ff_routes_s.currval,
2212: values (ff_routes_s.currval,
2213: l_tax_unit_context_id,
2214: 2);
2215:
2216: insert into ff_route_context_usages
2217: (route_id,
2218: context_id,
2219: sequence_no)
2220: values (ff_routes_s.currval,
2296: 1);
2297:
2298: -- define the route_context usage
2299:
2300: insert into ff_route_context_usages
2301: (route_id,
2302: context_id,
2303: sequence_no)
2304: values (ff_routes_s.currval,
2304: values (ff_routes_s.currval,
2305: l_assignment_action_context_id,
2306: 1);
2307:
2308: insert into ff_route_context_usages
2309: (route_id,
2310: context_id,
2311: sequence_no)
2312: values (ff_routes_s.currval,
2312: values (ff_routes_s.currval,
2313: l_tax_unit_context_id,
2314: 2);
2315:
2316: insert into ff_route_context_usages
2317: (route_id,
2318: context_id,
2319: sequence_no)
2320: values (ff_routes_s.currval,
2399: 1);
2400:
2401: -- define the route_context usage
2402:
2403: insert into ff_route_context_usages
2404: (route_id,
2405: context_id,
2406: sequence_no)
2407: values (ff_routes_s.currval,
2407: values (ff_routes_s.currval,
2408: l_assignment_action_context_id,
2409: 1);
2410:
2411: insert into ff_route_context_usages
2412: (route_id,
2413: context_id,
2414: sequence_no)
2415: values (ff_routes_s.currval,
2415: values (ff_routes_s.currval,
2416: l_tax_unit_context_id,
2417: 2);
2418:
2419: insert into ff_route_context_usages
2420: (route_id,
2421: context_id,
2422: sequence_no)
2423: values (ff_routes_s.currval,
2477: and dbi.user_entity_id = ue.user_entity_id;
2478: -- and ue.business_group_id is null;
2479: end; -- ]
2480: --
2481: select count(1) into l_asg_count from ff_route_context_usages rc,
2482: ff_contexts c
2483: where rc.context_id = c.context_id
2484: and rc.route_id = l_live_route_id
2485: and context_name like 'ASSIGNMENT%';
2682: cursor get_context is
2683: select c.context_name,
2684: rc.context_id,
2685: rc.sequence_no
2686: from ff_route_context_usages rc,
2687: ff_contexts c
2688: where rc.context_id = c.context_id
2689: and rc.route_id= l_live_route_id
2690: order by 3;