20: );
21:
22: g_params r_parameters;
23: glb_debug BOOLEAN := FALSE;
24: g_debug BOOLEAN := hr_utility.debug_enabled;
25: -- Used for conditionally enabling hr_utility calls
26: -- variables for storing the old bld blk information
27: t_old_time_seq DBMS_SQL.number_table;
28: t_old_day_seq DBMS_SQL.number_table;
21:
22: g_params r_parameters;
23: glb_debug BOOLEAN := FALSE;
24: g_debug BOOLEAN := hr_utility.debug_enabled;
25: -- Used for conditionally enabling hr_utility calls
26: -- variables for storing the old bld blk information
27: t_old_time_seq DBMS_SQL.number_table;
28: t_old_day_seq DBMS_SQL.number_table;
29: t_old_detail_seq DBMS_SQL.number_table;
252: BEGIN -- translate_it
253: IF g_debug
254: THEN
255: l_proc := g_package || 'translate_it';
256: hr_utility.set_location ('Entering ' || l_proc, 10);
257: END IF;
258:
259: -- placeholder is delimited by [ ], find the delimited string
260: l_start_position := INSTR (p_text, '[', 1, 1) + 1;
264: l_placeholder := SUBSTR (p_text, l_start_position, l_end_position);
265:
266: IF g_debug
267: THEN
268: hr_utility.set_location ('Processing ' || l_proc, 20);
269: END IF;
270:
271: -- predicate is delimited by {}, find the predicate
272: l_start_position := INSTR (p_text, '{', 1, 1) + 1;
276: l_predicate := SUBSTR (p_text, l_start_position, l_end_position);
277:
278: IF g_debug
279: THEN
280: hr_utility.set_location ('Processing ' || l_proc, 30);
281: END IF;
282:
283: -- now that we have the string ensure it is not a reserved keyword.
284: -- if it is then we can leave it be, otherwise we need to map this
304: g_field_mappings_table.FIRST .. g_field_mappings_table.LAST
305: LOOP
306: IF g_debug
307: THEN
308: hr_utility.set_location ('Processing ' || l_proc, 40);
309: END IF;
310:
311: -- check to see if placeholder matches field name
312: IF (g_field_mappings_table (map_cnt).field_name =
321: END LOOP;
322:
323: IF g_debug
324: THEN
325: hr_utility.set_location ('Processing ' || l_proc, 50);
326: END IF;
327:
328: IF (g_params.p_process = 'Projects Retrieval Process')
329: THEN
364: END IF; -- UPPER( l_placeholder
365:
366: IF g_debug
367: THEN
368: hr_utility.set_location ('Processing ' || l_proc, 60);
369: END IF;
370:
371: -- now replace the placeholder with the table dot column expression and remove the predicate all together
372: l_absolute_start_position := INSTR (p_text, '[', 1, 1);
458: BEGIN -- parse it
459: IF g_debug
460: THEN
461: l_proc := g_package || 'parse_it';
462: hr_utility.set_location ('Entering ' || l_proc, 10);
463: END IF;
464:
465: l_text := p_where_clause_blk;
466:
475: );
476:
477: IF g_debug
478: THEN
479: hr_utility.TRACE ('where blk is ' || p_where_clause_blk);
480: hr_utility.TRACE ('where att is ' || p_where_clause_att);
481: END IF;
482: END LOOP;
483: END IF;
476:
477: IF g_debug
478: THEN
479: hr_utility.TRACE ('where blk is ' || p_where_clause_blk);
480: hr_utility.TRACE ('where att is ' || p_where_clause_att);
481: END IF;
482: END LOOP;
483: END IF;
484:
483: END IF;
484:
485: IF g_debug
486: THEN
487: hr_utility.set_location ('Leaving ' || l_proc, 20);
488: END IF;
489:
490: -- using length since the ASCII new line is left when the WHERE has carriage returns
491: IF (LENGTH (LTRIM (RTRIM (p_where_clause_att))) > 5)
619: BEGIN
620: IF g_debug
621: THEN
622: l_proc := g_package || 'generate_resource_sql';
623: hr_utility.TRACE ('in generate resource sql');
624: END IF;
625:
626: -- preserve caveat for skipping resources
627: OPEN csr_get_range ('LOWER');
645: l_range_caveat := TRUE;
646:
647: IF g_debug
648: THEN
649: hr_utility.TRACE ('Using range caveat');
650: END IF;
651: END IF;
652: ELSE
653: CLOSE csr_get_range;
666: );
667:
668: IF g_debug
669: THEN
670: hr_utility.TRACE ('after parse ');
671: hr_utility.TRACE (SUBSTR (l_where_blk, 1, 250));
672: END IF;
673:
674: l_where_blk := replace_timecard_string (l_where_blk);
667:
668: IF g_debug
669: THEN
670: hr_utility.TRACE ('after parse ');
671: hr_utility.TRACE (SUBSTR (l_where_blk, 1, 250));
672: END IF;
673:
674: l_where_blk := replace_timecard_string (l_where_blk);
675:
674: l_where_blk := replace_timecard_string (l_where_blk);
675:
676: IF g_debug
677: THEN
678: hr_utility.TRACE ('after replace ');
679: hr_utility.TRACE (SUBSTR (l_where_blk, 1, 250));
680: END IF;
681:
682: IF (g_params.l_using_dates)
675:
676: IF g_debug
677: THEN
678: hr_utility.TRACE ('after replace ');
679: hr_utility.TRACE (SUBSTR (l_where_blk, 1, 250));
680: END IF;
681:
682: IF (g_params.l_using_dates)
683: THEN
682: IF (g_params.l_using_dates)
683: THEN
684: IF g_debug
685: THEN
686: hr_utility.TRACE ('Using Dates');
687: END IF;
688:
689: IF (l_range_caveat)
690: THEN
703: END IF;
704: ELSE
705: IF g_debug
706: THEN
707: hr_utility.TRACE ('Not using dates');
708: END IF;
709:
710: IF (l_range_caveat)
711: THEN
726: IF (g_params.l_using_dates)
727: THEN
728: IF g_debug
729: THEN
730: hr_utility.TRACE ('Using Dates');
731: END IF;
732:
733: IF (l_range_caveat)
734: THEN
745: END IF;
746: ELSE
747: IF g_debug
748: THEN
749: hr_utility.TRACE ('Not using dates');
750: END IF;
751:
752: IF (l_range_caveat)
753: THEN
766: END IF;
767:
768: IF g_debug
769: THEN
770: hr_utility.TRACE ('dynamic sql is ');
771: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 1, 250));
772: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 251, 250));
773: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 501, 250));
774: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 751, 250));
767:
768: IF g_debug
769: THEN
770: hr_utility.TRACE ('dynamic sql is ');
771: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 1, 250));
772: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 251, 250));
773: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 501, 250));
774: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 751, 250));
775: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 1001, 250));
768: IF g_debug
769: THEN
770: hr_utility.TRACE ('dynamic sql is ');
771: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 1, 250));
772: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 251, 250));
773: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 501, 250));
774: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 751, 250));
775: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 1001, 250));
776: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 1251, 250));
769: THEN
770: hr_utility.TRACE ('dynamic sql is ');
771: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 1, 250));
772: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 251, 250));
773: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 501, 250));
774: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 751, 250));
775: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 1001, 250));
776: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 1251, 250));
777: hr_utility.TRACE ( 'FIRST RESOURCE IS : '
770: hr_utility.TRACE ('dynamic sql is ');
771: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 1, 250));
772: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 251, 250));
773: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 501, 250));
774: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 751, 250));
775: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 1001, 250));
776: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 1251, 250));
777: hr_utility.TRACE ( 'FIRST RESOURCE IS : '
778: || TO_CHAR (l_first_resource_id)
771: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 1, 250));
772: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 251, 250));
773: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 501, 250));
774: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 751, 250));
775: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 1001, 250));
776: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 1251, 250));
777: hr_utility.TRACE ( 'FIRST RESOURCE IS : '
778: || TO_CHAR (l_first_resource_id)
779: );
772: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 251, 250));
773: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 501, 250));
774: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 751, 250));
775: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 1001, 250));
776: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 1251, 250));
777: hr_utility.TRACE ( 'FIRST RESOURCE IS : '
778: || TO_CHAR (l_first_resource_id)
779: );
780: hr_utility.TRACE ( 'LAST RESOURCE IS : '
773: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 501, 250));
774: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 751, 250));
775: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 1001, 250));
776: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 1251, 250));
777: hr_utility.TRACE ( 'FIRST RESOURCE IS : '
778: || TO_CHAR (l_first_resource_id)
779: );
780: hr_utility.TRACE ( 'LAST RESOURCE IS : '
781: || TO_CHAR (l_last_resource_id)
776: hr_utility.TRACE (SUBSTR (l_dynamic_sql, 1251, 250));
777: hr_utility.TRACE ( 'FIRST RESOURCE IS : '
778: || TO_CHAR (l_first_resource_id)
779: );
780: hr_utility.TRACE ( 'LAST RESOURCE IS : '
781: || TO_CHAR (l_last_resource_id)
782: );
783: END IF;
784:
803: BEGIN
804: IF g_debug
805: THEN
806: l_proc := g_package || '.insert_rr_resources';
807: hr_utility.set_location ('Entering ' || l_proc, 10);
808: END IF;
809:
810: OPEN csr_get_rr_id;
811:
823: );
824:
825: IF g_debug
826: THEN
827: hr_utility.set_location ('Leaving ' || l_proc, 10);
828: END IF;
829: END insert_rr_resources;
830:
831: FUNCTION chk_empty
883:
884: RETURN FALSE;
885: END chk_empty;
886: BEGIN
887: g_debug := hr_utility.debug_enabled;
888:
889: IF g_debug
890: THEN
891: l_proc := g_package || 'maintain_ranges';
888:
889: IF g_debug
890: THEN
891: l_proc := g_package || 'maintain_ranges';
892: hr_utility.set_location ('Processing ' || l_proc, 10);
893: END IF;
894:
895: -- if the table is empty for the retrieval process
896: -- then insert the rows
900: -- exception. If this occurs then we want to requery the table
901: -- until no exception
902: IF g_debug
903: THEN
904: hr_utility.TRACE ('Entering maintain_ranges');
905: END IF;
906:
907: WHILE l_not_maintained_ranges
908: LOOP
907: WHILE l_not_maintained_ranges
908: LOOP
909: IF g_debug
910: THEN
911: hr_utility.set_location ('Processing ' || l_proc, 20);
912: END IF;
913:
914: BEGIN
915: IF g_debug
913:
914: BEGIN
915: IF g_debug
916: THEN
917: hr_utility.TRACE ('Locking table');
918: END IF;
919:
920: IF NOT hxc_generic_retrieval_pkg.g_in_loop
921: THEN
924: IN EXCLUSIVE MODE NOWAIT;
925:
926: IF g_debug
927: THEN
928: hr_utility.TRACE ('Before chk empty');
929: END IF;
930:
931: IF (chk_empty)
932: THEN
939: l_chunk_size := g_params.transfer_batch_size;
940:
941: IF g_debug
942: THEN
943: hr_utility.TRACE ( 'Chunk Size Profile Value is '
944: || TO_CHAR (l_chunk_size)
945: );
946: END IF;
947:
955: END IF;
956:
957: IF g_debug
958: THEN
959: hr_utility.TRACE ('Inserting rows');
960: END IF;
961:
962: -- insert rows
963: IF g_debug
961:
962: -- insert rows
963: IF g_debug
964: THEN
965: hr_utility.TRACE ('using dynamic SQL for resource list');
966: END IF;
967:
968: -- use dynamic SQL BULK FETCH to generate resource list
969: l_rows_fetched := l_chunk_size;
987: WHILE (l_rows_fetched = l_chunk_size)
988: LOOP
989: IF g_debug
990: THEN
991: hr_utility.TRACE ('in loop');
992: END IF;
993:
994: l_rows_fetched := DBMS_SQL.fetch_rows (l_csr);
995:
994: l_rows_fetched := DBMS_SQL.fetch_rows (l_csr);
995:
996: IF g_debug
997: THEN
998: hr_utility.TRACE ( 'rows fetched is '
999: || TO_CHAR (l_rows_fetched)
1000: );
1001: END IF;
1002:
1003: IF (l_rows_fetched = 0 AND t_range_start.COUNT = 0)
1004: THEN
1005: IF g_debug
1006: THEN
1007: hr_utility.TRACE ('No ranges !!!');
1008: END IF;
1009:
1010: DBMS_SQL.close_cursor (l_csr);
1011: RAISE e_no_ranges;
1024: x := x + 1;
1025:
1026: IF g_debug
1027: THEN
1028: hr_utility.TRACE ( 'range_start is '
1029: || TO_CHAR (l_range_start)
1030: );
1031: hr_utility.TRACE ( 'range_stop is '
1032: || TO_CHAR (l_range_stop)
1027: THEN
1028: hr_utility.TRACE ( 'range_start is '
1029: || TO_CHAR (l_range_start)
1030: );
1031: hr_utility.TRACE ( 'range_stop is '
1032: || TO_CHAR (l_range_stop)
1033: );
1034: END IF;
1035:
1041: t_where_clause (x) := g_params.p_where_clause;
1042:
1043: IF g_debug
1044: THEN
1045: hr_utility.TRACE ( 'loop conditions is '
1046: || TO_CHAR (l_rows_fetched)
1047: || ':'
1048: || TO_CHAR (l_chunk_size)
1049: );
1054: END LOOP; -- dynamic fetch of resources
1055:
1056: IF g_debug
1057: THEN
1058: hr_utility.TRACE ('Leaving loop');
1059: END IF;
1060:
1061: DBMS_SQL.close_cursor (l_csr);
1062: -- now insert retrieval ranges
1076: );
1077:
1078: IF g_debug
1079: THEN
1080: hr_utility.TRACE ('After bulk insert');
1081: END IF;
1082:
1083: l_not_maintained_ranges := FALSE;
1084: END IF; -- chk_empty
1084: END IF; -- chk_empty
1085:
1086: IF g_debug
1087: THEN
1088: hr_utility.set_location ('Processing ' || l_proc, 30);
1089: END IF;
1090: END IF; -- NOT hxc_generic_retrieval_pkg.G_IN_LOOP
1091:
1092: IF g_debug
1090: END IF; -- NOT hxc_generic_retrieval_pkg.G_IN_LOOP
1091:
1092: IF g_debug
1093: THEN
1094: hr_utility.set_location ('Processing ' || l_proc, 40);
1095: hr_utility.TRACE ('About to get range value');
1096: END IF;
1097:
1098: -- if the table is not empty then select the next row, lock it
1091:
1092: IF g_debug
1093: THEN
1094: hr_utility.set_location ('Processing ' || l_proc, 40);
1095: hr_utility.TRACE ('About to get range value');
1096: END IF;
1097:
1098: -- if the table is not empty then select the next row, lock it
1099: -- set the range values and update the row
1105: IF (csr_get_next_range%FOUND)
1106: THEN
1107: IF g_debug
1108: THEN
1109: hr_utility.TRACE ('FOUND range value');
1110: END IF;
1111:
1112: -- maintain range
1113: UPDATE hxc_retrieval_ranges rr
1122: l_pkg_retrieval_range_id := r_range.retrieval_range_id;
1123: ELSE
1124: IF g_debug
1125: THEN
1126: hr_utility.TRACE ('NOT FOUND range value');
1127: END IF;
1128:
1129: -- no more ranges
1130:
1137: END IF;
1138:
1139: IF g_debug
1140: THEN
1141: hr_utility.set_location ('Processing ' || l_proc, 50);
1142: END IF;
1143:
1144: CLOSE csr_get_next_range;
1145:
1149: WHEN OTHERS
1150: THEN
1151: IF g_debug
1152: THEN
1153: hr_utility.TRACE ('sqlerrm is ' || SQLERRM);
1154: hr_utility.TRACE ('sqlcode is ' || SQLCODE);
1155: END IF;
1156:
1157: IF (SQLCODE = '-54')
1150: THEN
1151: IF g_debug
1152: THEN
1153: hr_utility.TRACE ('sqlerrm is ' || SQLERRM);
1154: hr_utility.TRACE ('sqlcode is ' || SQLCODE);
1155: END IF;
1156:
1157: IF (SQLCODE = '-54')
1158: THEN
1157: IF (SQLCODE = '-54')
1158: THEN
1159: IF g_debug
1160: THEN
1161: hr_utility.TRACE ('TABLE LOCKED!!!!');
1162: END IF;
1163:
1164: l_cnt := l_cnt + 1;
1165: -- wait for 30 seconds before attempting to lock again
1170: END; -- anonymous PL/SQL block to trap lock exception
1171:
1172: IF g_debug
1173: THEN
1174: hr_utility.set_location ('Processing ' || l_proc, 60);
1175: END IF;
1176:
1177: IF (l_cnt > 60)
1178: THEN
1184: END IF;
1185:
1186: IF g_debug
1187: THEN
1188: hr_utility.set_location ('Processing ' || l_proc, 70);
1189: END IF;
1190: END LOOP;
1191: END maintain_ranges;
1192:
1213: BEGIN
1214: IF g_debug
1215: THEN
1216: l_proc := g_package || 'maintain_chunks';
1217: hr_utility.set_location ('Entering ' || l_proc, 10);
1218: END IF;
1219:
1220: IF (g_params.p_process IN
1221: ('Projects Retrieval Process',
1226: )
1227: THEN
1228: IF g_debug
1229: THEN
1230: hr_utility.set_location ('Entering ' || l_proc, 20);
1231: END IF;
1232:
1233: maintain_ranges (p_process_id => g_retrieval_process_id,
1234: p_range_start => l_pkg_range_start,
1237: );
1238:
1239: IF g_debug
1240: THEN
1241: hr_utility.set_location ('Entering ' || l_proc, 50);
1242: END IF;
1243: ELSE
1244: IF g_debug
1245: THEN
1242: END IF;
1243: ELSE
1244: IF g_debug
1245: THEN
1246: hr_utility.set_location ('Entering ' || l_proc, 80);
1247: END IF;
1248:
1249: -- not the Project Retrieval Process
1250: -- set range to be full range
1253: END IF; -- IF ( g_params.p_process = 'Projects Retrieval Process')
1254:
1255: IF g_debug
1256: THEN
1257: hr_utility.TRACE ('');
1258: hr_utility.TRACE ('******* GLOBALS AFTER MAINTAIN CHUNKS ********');
1259: END IF;
1260:
1261: IF (g_in_loop)
1254:
1255: IF g_debug
1256: THEN
1257: hr_utility.TRACE ('');
1258: hr_utility.TRACE ('******* GLOBALS AFTER MAINTAIN CHUNKS ********');
1259: END IF;
1260:
1261: IF (g_in_loop)
1262: THEN
1261: IF (g_in_loop)
1262: THEN
1263: IF g_debug
1264: THEN
1265: hr_utility.TRACE ('G_IN_LOOP is TRUE');
1266: END IF;
1267: ELSE
1268: IF g_debug
1269: THEN
1266: END IF;
1267: ELSE
1268: IF g_debug
1269: THEN
1270: hr_utility.TRACE ('G_IN_LOOP is FALSE');
1271: END IF;
1272: END IF;
1273:
1274: IF (g_last_chunk)
1274: IF (g_last_chunk)
1275: THEN
1276: IF g_debug
1277: THEN
1278: hr_utility.TRACE ('G_LAST_CHUNK is TRUE');
1279: END IF;
1280: ELSE
1281: IF g_debug
1282: THEN
1279: END IF;
1280: ELSE
1281: IF g_debug
1282: THEN
1283: hr_utility.TRACE ('G_LAST_CHUNK is FALSE');
1284: END IF;
1285: END IF;
1286:
1287: IF g_debug
1285: END IF;
1286:
1287: IF g_debug
1288: THEN
1289: hr_utility.TRACE ('l_range_start is ' || TO_CHAR (l_pkg_range_start));
1290: hr_utility.TRACE ('l_range_stop is ' || TO_CHAR (l_pkg_range_stop));
1291: hr_utility.TRACE ( 'l retrieval range id is '
1292: || TO_CHAR (l_pkg_retrieval_range_id)
1293: );
1286:
1287: IF g_debug
1288: THEN
1289: hr_utility.TRACE ('l_range_start is ' || TO_CHAR (l_pkg_range_start));
1290: hr_utility.TRACE ('l_range_stop is ' || TO_CHAR (l_pkg_range_stop));
1291: hr_utility.TRACE ( 'l retrieval range id is '
1292: || TO_CHAR (l_pkg_retrieval_range_id)
1293: );
1294: END IF;
1287: IF g_debug
1288: THEN
1289: hr_utility.TRACE ('l_range_start is ' || TO_CHAR (l_pkg_range_start));
1290: hr_utility.TRACE ('l_range_stop is ' || TO_CHAR (l_pkg_range_stop));
1291: hr_utility.TRACE ( 'l retrieval range id is '
1292: || TO_CHAR (l_pkg_retrieval_range_id)
1293: );
1294: END IF;
1295: END maintain_chunks;
1360: l_ret_criteria_clause := hxc_generic_retrieval_utils.get_ret_criteria;
1361:
1362: IF g_debug
1363: THEN
1364: hr_utility.TRACE ('Entering populate_ret_range_blks');
1365: END IF;
1366:
1367: -- only use temp table for processes which loop
1368: IF (g_params.p_process IN
1374: )
1375: THEN
1376: IF g_debug
1377: THEN
1378: hr_utility.TRACE ('starting to build query');
1379: END IF;
1380:
1381: IF (g_params.l_using_dates)
1382: THEN
1381: IF (g_params.l_using_dates)
1382: THEN
1383: IF g_debug
1384: THEN
1385: hr_utility.TRACE ('Using Dates');
1386: END IF;
1387:
1388: l_start_date :=
1389: NVL (g_params.p_start_date, hr_general.start_of_time);
1391: END IF;
1392:
1393: IF g_debug
1394: THEN
1395: hr_utility.TRACE ('About to delete rows');
1396: END IF;
1397:
1398: DELETE FROM hxc_retrieval_range_blks;
1399:
1443: END IF;
1444:
1445: IF g_debug
1446: THEN
1447: hr_utility.TRACE ('dynamic ret range blk sql is ');
1448: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1, 250));
1449: hr_utility.TRACE (SUBSTR (l_ret_range_query, 251, 250));
1450: hr_utility.TRACE (SUBSTR (l_ret_range_query, 501, 250));
1451: hr_utility.TRACE (SUBSTR (l_ret_range_query, 751, 250));
1444:
1445: IF g_debug
1446: THEN
1447: hr_utility.TRACE ('dynamic ret range blk sql is ');
1448: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1, 250));
1449: hr_utility.TRACE (SUBSTR (l_ret_range_query, 251, 250));
1450: hr_utility.TRACE (SUBSTR (l_ret_range_query, 501, 250));
1451: hr_utility.TRACE (SUBSTR (l_ret_range_query, 751, 250));
1452: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1001, 250));
1445: IF g_debug
1446: THEN
1447: hr_utility.TRACE ('dynamic ret range blk sql is ');
1448: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1, 250));
1449: hr_utility.TRACE (SUBSTR (l_ret_range_query, 251, 250));
1450: hr_utility.TRACE (SUBSTR (l_ret_range_query, 501, 250));
1451: hr_utility.TRACE (SUBSTR (l_ret_range_query, 751, 250));
1452: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1001, 250));
1453: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1251, 250));
1446: THEN
1447: hr_utility.TRACE ('dynamic ret range blk sql is ');
1448: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1, 250));
1449: hr_utility.TRACE (SUBSTR (l_ret_range_query, 251, 250));
1450: hr_utility.TRACE (SUBSTR (l_ret_range_query, 501, 250));
1451: hr_utility.TRACE (SUBSTR (l_ret_range_query, 751, 250));
1452: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1001, 250));
1453: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1251, 250));
1454: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1501, 250));
1447: hr_utility.TRACE ('dynamic ret range blk sql is ');
1448: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1, 250));
1449: hr_utility.TRACE (SUBSTR (l_ret_range_query, 251, 250));
1450: hr_utility.TRACE (SUBSTR (l_ret_range_query, 501, 250));
1451: hr_utility.TRACE (SUBSTR (l_ret_range_query, 751, 250));
1452: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1001, 250));
1453: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1251, 250));
1454: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1501, 250));
1455: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1751, 250));
1448: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1, 250));
1449: hr_utility.TRACE (SUBSTR (l_ret_range_query, 251, 250));
1450: hr_utility.TRACE (SUBSTR (l_ret_range_query, 501, 250));
1451: hr_utility.TRACE (SUBSTR (l_ret_range_query, 751, 250));
1452: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1001, 250));
1453: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1251, 250));
1454: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1501, 250));
1455: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1751, 250));
1456: END IF;
1449: hr_utility.TRACE (SUBSTR (l_ret_range_query, 251, 250));
1450: hr_utility.TRACE (SUBSTR (l_ret_range_query, 501, 250));
1451: hr_utility.TRACE (SUBSTR (l_ret_range_query, 751, 250));
1452: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1001, 250));
1453: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1251, 250));
1454: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1501, 250));
1455: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1751, 250));
1456: END IF;
1457:
1450: hr_utility.TRACE (SUBSTR (l_ret_range_query, 501, 250));
1451: hr_utility.TRACE (SUBSTR (l_ret_range_query, 751, 250));
1452: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1001, 250));
1453: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1251, 250));
1454: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1501, 250));
1455: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1751, 250));
1456: END IF;
1457:
1458: insert_query (l_ret_range_query, 'RET_RANGE_BLKS');
1451: hr_utility.TRACE (SUBSTR (l_ret_range_query, 751, 250));
1452: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1001, 250));
1453: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1251, 250));
1454: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1501, 250));
1455: hr_utility.TRACE (SUBSTR (l_ret_range_query, 1751, 250));
1456: END IF;
1457:
1458: insert_query (l_ret_range_query, 'RET_RANGE_BLKS');
1459: -- now fetch and insert the rows
1552: END IF; -- check retrieval process
1553: /*
1554:
1555: if g_debug then
1556: hr_utility.trace('Here is the table ');
1557: end if;
1558: open csr_get_ret_Range_blks;
1559:
1560: fetch csr_get_ret_range_blks into l_ret_range_rec;
1562: WHILE csr_get_ret_range_blks%FOUND
1563: LOOP
1564:
1565: if g_debug then
1566: hr_utility.trace('ret range blks is '||l_ret_range_rec.tbb_id||':'||l_ret_range_rec.tbb_ovn);
1567: end if;
1568:
1569: fetch csr_get_ret_range_blks into l_ret_range_rec;
1570:
1665: l_end_date DATE;
1666: BEGIN
1667: IF g_debug
1668: THEN
1669: hr_utility.TRACE ('Entering populate_max_ovn');
1670: END IF;
1671:
1672: -- clear out the table
1673: DELETE FROM hxc_max_ovn;
1684:
1685: LOOP
1686: IF g_debug
1687: THEN
1688: hr_utility.TRACE ('in max ovn loop');
1689: END IF;
1690:
1691: FETCH csr_get_max_ovn_rrb
1692: BULK COLLECT INTO t_max_ovn_bb_id, t_max_ovn LIMIT 100;
1692: BULK COLLECT INTO t_max_ovn_bb_id, t_max_ovn LIMIT 100;
1693:
1694: IF g_debug
1695: THEN
1696: hr_utility.TRACE ( 'fetch count is '
1697: || TO_CHAR (t_max_ovn_bb_id.COUNT)
1698: );
1699: END IF;
1700:
1756:
1757: LOOP
1758: IF g_debug
1759: THEN
1760: hr_utility.TRACE ('in max ovn loop');
1761: END IF;
1762:
1763: FETCH csr_get_max_ovn
1764: BULK COLLECT INTO t_max_ovn_bb_id, t_max_ovn LIMIT 100;
1764: BULK COLLECT INTO t_max_ovn_bb_id, t_max_ovn LIMIT 100;
1765:
1766: IF g_debug
1767: THEN
1768: hr_utility.TRACE ( 'fetch count is '
1769: || TO_CHAR (t_max_ovn_bb_id.COUNT)
1770: );
1771: END IF;
1772:
1773: IF (t_max_ovn_bb_id.COUNT <> 0)
1774: THEN
1775: IF g_debug
1776: THEN
1777: hr_utility.TRACE ('inserting');
1778: END IF;
1779:
1780: FORALL x IN t_max_ovn_bb_id.FIRST .. t_max_ovn_bb_id.LAST
1781: INSERT INTO hxc_max_ovn
1800:
1801: fetch csr_get_max_ovn_debug into l_max_ovn;
1802:
1803: if g_debug then
1804: hr_utility.trace(l_max_ovn.ovn);
1805: end if;
1806:
1807: exit when csr_get_max_ovn_debug%NOTFOUND;
1808:
1851: BEGIN -- audit transaction
1852: IF g_debug
1853: THEN
1854: l_proc := g_package || 'audit_transaction';
1855: hr_utility.set_location ('Entering ' || l_proc, 10);
1856: hr_utility.TRACE ('Audit Transaction Params');
1857: hr_utility.TRACE ('p_mode is ' || p_mode);
1858: hr_utility.TRACE ( 'p_transaction_process_id is '
1859: || TO_CHAR (p_transaction_process_id)
1852: IF g_debug
1853: THEN
1854: l_proc := g_package || 'audit_transaction';
1855: hr_utility.set_location ('Entering ' || l_proc, 10);
1856: hr_utility.TRACE ('Audit Transaction Params');
1857: hr_utility.TRACE ('p_mode is ' || p_mode);
1858: hr_utility.TRACE ( 'p_transaction_process_id is '
1859: || TO_CHAR (p_transaction_process_id)
1860: );
1853: THEN
1854: l_proc := g_package || 'audit_transaction';
1855: hr_utility.set_location ('Entering ' || l_proc, 10);
1856: hr_utility.TRACE ('Audit Transaction Params');
1857: hr_utility.TRACE ('p_mode is ' || p_mode);
1858: hr_utility.TRACE ( 'p_transaction_process_id is '
1859: || TO_CHAR (p_transaction_process_id)
1860: );
1861: hr_utility.TRACE ('p_status is ' || p_status);
1854: l_proc := g_package || 'audit_transaction';
1855: hr_utility.set_location ('Entering ' || l_proc, 10);
1856: hr_utility.TRACE ('Audit Transaction Params');
1857: hr_utility.TRACE ('p_mode is ' || p_mode);
1858: hr_utility.TRACE ( 'p_transaction_process_id is '
1859: || TO_CHAR (p_transaction_process_id)
1860: );
1861: hr_utility.TRACE ('p_status is ' || p_status);
1862: hr_utility.TRACE ('p_description is ' || p_description);
1857: hr_utility.TRACE ('p_mode is ' || p_mode);
1858: hr_utility.TRACE ( 'p_transaction_process_id is '
1859: || TO_CHAR (p_transaction_process_id)
1860: );
1861: hr_utility.TRACE ('p_status is ' || p_status);
1862: hr_utility.TRACE ('p_description is ' || p_description);
1863: hr_utility.TRACE ( 'Global Transaction ID is '
1864: || TO_CHAR
1865: (hxc_generic_retrieval_pkg.g_transaction_id)
1858: hr_utility.TRACE ( 'p_transaction_process_id is '
1859: || TO_CHAR (p_transaction_process_id)
1860: );
1861: hr_utility.TRACE ('p_status is ' || p_status);
1862: hr_utility.TRACE ('p_description is ' || p_description);
1863: hr_utility.TRACE ( 'Global Transaction ID is '
1864: || TO_CHAR
1865: (hxc_generic_retrieval_pkg.g_transaction_id)
1866: );
1859: || TO_CHAR (p_transaction_process_id)
1860: );
1861: hr_utility.TRACE ('p_status is ' || p_status);
1862: hr_utility.TRACE ('p_description is ' || p_description);
1863: hr_utility.TRACE ( 'Global Transaction ID is '
1864: || TO_CHAR
1865: (hxc_generic_retrieval_pkg.g_transaction_id)
1866: );
1867: END IF;
1877: IF (hxc_generic_retrieval_pkg.g_transaction_id IS NOT NULL)
1878: THEN
1879: IF g_debug
1880: THEN
1881: hr_utility.set_location ('Processing ' || l_proc, 7);
1882: END IF;
1883:
1884: -- already inserted - lets update it!
1885: UPDATE hxc_transactions
1888: WHERE transaction_id = hxc_generic_retrieval_pkg.g_transaction_id;
1889: ELSE
1890: IF g_debug
1891: THEN
1892: hr_utility.set_location ('Processing ' || l_proc, 20);
1893: END IF;
1894:
1895: OPEN csr_get_tx_id;
1896:
1900: CLOSE csr_get_tx_id;
1901:
1902: IF g_debug
1903: THEN
1904: hr_utility.set_location ('Processing ' || l_proc, 30);
1905: END IF;
1906:
1907: INSERT INTO hxc_transactions
1908: (transaction_id,
1919: );
1920:
1921: IF g_debug
1922: THEN
1923: hr_utility.set_location ('Processing ' || l_proc, 40);
1924: END IF;
1925: END IF; -- transaction id IS NULL
1926:
1927: IF l_error_max <> 0
1927: IF l_error_max <> 0
1928: THEN
1929: IF g_debug
1930: THEN
1931: hr_utility.set_location ('Processing ' || l_proc, 85);
1932: END IF;
1933:
1934: -- now let's bulk fetch all the transaction detail id
1935: OPEN csr_get_tx_detail_id (l_error_max);
1943: l_temp_transaction_id;
1944:
1945: IF g_debug
1946: THEN
1947: hr_utility.set_location ('Processing ' || l_proc, 90);
1948: END IF;
1949:
1950: FORALL tx_error IN hxc_generic_retrieval_pkg.t_tx_error_transaction_id.FIRST .. hxc_generic_retrieval_pkg.t_tx_error_transaction_id.LAST
1951: INSERT INTO hxc_transaction_details
1977: hxc_generic_retrieval_pkg.t_tx_error_exception.DELETE;
1978:
1979: IF g_debug
1980: THEN
1981: hr_utility.set_location ('Processing ' || l_proc, 100);
1982: END IF;
1983: END IF; -- l_error_max <> 0
1984: ELSIF (p_mode = 'U') -- update transactions
1985: THEN
1984: ELSIF (p_mode = 'U') -- update transactions
1985: THEN
1986: IF g_debug
1987: THEN
1988: hr_utility.set_location ('Processing ' || l_proc, 110);
1989: END IF;
1990:
1991: OPEN csr_get_tx_id;
1992:
2022: END IF;
2023:
2024: IF g_debug
2025: THEN
2026: hr_utility.set_location ('Processing ' || l_proc, 130);
2027: END IF;
2028:
2029: -- check to see if any tx time details
2030: IF l_time_max <> 0
2041: l_temp_transaction_id;
2042:
2043: IF g_debug
2044: THEN
2045: hr_utility.set_location ('Processing ' || l_proc, 50);
2046: END IF;
2047:
2048: FORALL tx_detail IN hxc_generic_retrieval_pkg.t_tx_time_transaction_id.FIRST .. hxc_generic_retrieval_pkg.t_tx_time_transaction_id.LAST
2049: INSERT INTO hxc_transaction_details
2083: l_temp_transaction_id;
2084:
2085: IF g_debug
2086: THEN
2087: hr_utility.set_location ('Processing ' || l_proc, 60);
2088: END IF;
2089:
2090: FORALL tx_detail IN hxc_generic_retrieval_pkg.t_tx_day_transaction_id.FIRST .. hxc_generic_retrieval_pkg.t_tx_day_transaction_id.LAST
2091: INSERT INTO hxc_transaction_details
2125: l_temp_transaction_id;
2126:
2127: IF g_debug
2128: THEN
2129: hr_utility.set_location ('Processing ' || l_proc, 70);
2130: END IF;
2131:
2132: FORALL tx_detail IN hxc_generic_retrieval_pkg.t_tx_detail_transaction_id.FIRST .. hxc_generic_retrieval_pkg.t_tx_detail_transaction_id.LAST
2133: INSERT INTO hxc_transaction_details
2152: );
2153:
2154: IF g_debug
2155: THEN
2156: hr_utility.set_location ('Processing ' || l_proc, 75);
2157: END IF;
2158: END IF; -- l_detail_max <> 0
2159:
2160: IF g_debug
2158: END IF; -- l_detail_max <> 0
2159:
2160: IF g_debug
2161: THEN
2162: hr_utility.set_location ('Processing ' || l_proc, 80);
2163: END IF;
2164:
2165: IF l_error_max <> 0
2166: THEN
2165: IF l_error_max <> 0
2166: THEN
2167: IF g_debug
2168: THEN
2169: hr_utility.set_location ('Processing ' || l_proc, 85);
2170: END IF;
2171:
2172: -- now let's bulk fetch all the transaction detail id
2173: OPEN csr_get_tx_detail_id (l_error_max);
2181: l_temp_transaction_id;
2182:
2183: IF g_debug
2184: THEN
2185: hr_utility.set_location ('Processing ' || l_proc, 90);
2186: END IF;
2187:
2188: FORALL tx_error IN hxc_generic_retrieval_pkg.t_tx_error_transaction_id.FIRST .. hxc_generic_retrieval_pkg.t_tx_error_transaction_id.LAST
2189: INSERT INTO hxc_transaction_details
2215: hxc_generic_retrieval_pkg.t_tx_error_exception.DELETE;
2216:
2217: IF g_debug
2218: THEN
2219: hr_utility.set_location ('Processing ' || l_proc, 100);
2220: END IF;
2221: END IF; -- l_error_max <> 0
2222: END IF; -- p_mode
2223:
2222: END IF; -- p_mode
2223:
2224: IF g_debug
2225: THEN
2226: hr_utility.TRACE ('Committing !!!');
2227: END IF;
2228:
2229: COMMIT;
2230: END audit_transaction;
2273: BEGIN -- chk_retrieval_process
2274: IF g_debug
2275: THEN
2276: l_proc := g_package || 'chk_retrieval_process';
2277: hr_utility.set_location ('Entering ' || l_proc, 10);
2278: END IF;
2279:
2280: IF (p_retrieval_process = 'Apply Schedule Rules')
2281: THEN
2315: END IF;
2316:
2317: IF g_debug
2318: THEN
2319: hr_utility.set_location ('Leaving ' || l_proc, 30);
2320: END IF;
2321: --
2322: END chk_retrieval_process;
2323:
4131: BEGIN -- query_it
4132: IF g_debug
4133: THEN
4134: l_proc := g_package || 'query_it';
4135: hr_utility.set_location ('Entering ' || l_proc, 10);
4136: END IF;
4137:
4138: OPEN get_session_number_format;
4139: FETCH get_session_number_format into l_number_format;
4143: l_rows_fetched := l_max_array_size;
4144:
4145: IF g_debug
4146: THEN
4147: hr_utility.set_location ('Processing ' || l_proc, 20);
4148: END IF;
4149:
4150: l_csr := DBMS_SQL.open_cursor;
4151:
4150: l_csr := DBMS_SQL.open_cursor;
4151:
4152: IF g_debug
4153: THEN
4154: hr_utility.set_location ('Processing ' || l_proc, 30);
4155: END IF;
4156:
4157: DBMS_SQL.parse (l_csr, l_query_text, DBMS_SQL.native);
4158:
4180:
4181: -- bind the start and end date parameters
4182: IF g_debug
4183: THEN
4184: hr_utility.set_location ('Processing ' || l_proc, 35);
4185: END IF;
4186:
4187: IF ( ( g_params.p_start_date IS NOT NULL
4188: AND g_params.p_end_date IS NOT NULL
4199: END IF;
4200:
4201: IF g_debug
4202: THEN
4203: hr_utility.set_location ('Processing ' || l_proc, 37);
4204: END IF;
4205:
4206: IF (g_params.p_rerun_flag = 'Y')
4207: THEN
4213:
4214: -- define arrays for each item in the select list
4215: IF g_debug
4216: THEN
4217: hr_utility.set_location ('Processing ' || l_proc, 40);
4218: END IF;
4219:
4220: DBMS_SQL.define_array (c => l_csr,
4221: POSITION => 1,
4597: );
4598:
4599: IF g_debug
4600: THEN
4601: hr_utility.set_location ('Processing ' || l_proc, 50);
4602: END IF;
4603:
4604: l_dummy := DBMS_SQL.EXECUTE (l_csr);
4605:
4604: l_dummy := DBMS_SQL.EXECUTE (l_csr);
4605:
4606: IF g_debug
4607: THEN
4608: hr_utility.set_location ('Processing ' || l_proc, 60);
4609: END IF;
4610:
4611: -- loop to ensure we fetch all the rows
4612: WHILE (l_rows_fetched = l_max_array_size)
4877: DBMS_SQL.close_cursor (l_csr);
4878:
4879: IF g_debug
4880: THEN
4881: hr_utility.set_location ('Processing ' || l_proc, 110);
4882: END IF;
4883:
4884: IF (g_params.p_incremental = 'N')
4885: THEN
4909:
4910: -- initialise tables
4911: IF g_debug
4912: THEN
4913: hr_utility.TRACE ('Params to parse_resources......');
4914: hr_utility.TRACE ('Process id is '
4915: || TO_CHAR (g_retrieval_process_id)
4916: );
4917: hr_utility.TRACE ( 'Time Recipient id is '
4910: -- initialise tables
4911: IF g_debug
4912: THEN
4913: hr_utility.TRACE ('Params to parse_resources......');
4914: hr_utility.TRACE ('Process id is '
4915: || TO_CHAR (g_retrieval_process_id)
4916: );
4917: hr_utility.TRACE ( 'Time Recipient id is '
4918: || TO_CHAR (g_retrieval_tr_id)
4913: hr_utility.TRACE ('Params to parse_resources......');
4914: hr_utility.TRACE ('Process id is '
4915: || TO_CHAR (g_retrieval_process_id)
4916: );
4917: hr_utility.TRACE ( 'Time Recipient id is '
4918: || TO_CHAR (g_retrieval_tr_id)
4919: );
4920: END IF;
4921:
4932: );
4933:
4934: IF g_debug
4935: THEN
4936: hr_utility.TRACE (' *********** - GLOBAL TABLE INFO ************ ');
4937: END IF;
4938:
4939: l_count := hxc_generic_retrieval_utils.g_resources.COUNT;
4940:
4939: l_count := hxc_generic_retrieval_utils.g_resources.COUNT;
4940:
4941: IF g_debug
4942: THEN
4943: hr_utility.TRACE ('Resources : ' || TO_CHAR (l_count));
4944: END IF;
4945:
4946: l_count := t_bb.COUNT;
4947:
4946: l_count := t_bb.COUNT;
4947:
4948: IF g_debug
4949: THEN
4950: hr_utility.TRACE ('master bld blks : ' || TO_CHAR (l_count));
4951: END IF;
4952:
4953: l_count := l_prefs.COUNT;
4954:
4953: l_count := l_prefs.COUNT;
4954:
4955: IF g_debug
4956: THEN
4957: hr_utility.TRACE ('Prefs : ' || TO_CHAR (l_count));
4958: END IF;
4959:
4960: l_count := l_ret_rules.COUNT;
4961:
4960: l_count := l_ret_rules.COUNT;
4961:
4962: IF g_debug
4963: THEN
4964: hr_utility.TRACE ('Retrieval Rules : ' || TO_CHAR (l_count));
4965: END IF;
4966:
4967: l_count := l_rtr_outcomes.COUNT;
4968:
4967: l_count := l_rtr_outcomes.COUNT;
4968:
4969: IF g_debug
4970: THEN
4971: hr_utility.TRACE ('Ret Rule Outcomes : ' || TO_CHAR (l_count));
4972: END IF;
4973:
4974: l_count := l_errors.COUNT;
4975:
4974: l_count := l_errors.COUNT;
4975:
4976: IF g_debug
4977: THEN
4978: hr_utility.TRACE ('Errors : ' || TO_CHAR (l_count));
4979: END IF;
4980:
4981: -- now loop through the table and populate the building block table for those bld blks which have
4982: -- changed
4981: -- now loop through the table and populate the building block table for those bld blks which have
4982: -- changed
4983: IF g_debug
4984: THEN
4985: hr_utility.TRACE ('');
4986: hr_utility.TRACE ('****** Populating Global PL/SQL tables *******');
4987: hr_utility.TRACE ('');
4988: END IF;
4989:
4982: -- changed
4983: IF g_debug
4984: THEN
4985: hr_utility.TRACE ('');
4986: hr_utility.TRACE ('****** Populating Global PL/SQL tables *******');
4987: hr_utility.TRACE ('');
4988: END IF;
4989:
4990: FOR cnt IN t_bb.FIRST .. t_bb.LAST
4983: IF g_debug
4984: THEN
4985: hr_utility.TRACE ('');
4986: hr_utility.TRACE ('****** Populating Global PL/SQL tables *******');
4987: hr_utility.TRACE ('');
4988: END IF;
4989:
4990: FOR cnt IN t_bb.FIRST .. t_bb.LAST
4991: LOOP
4989:
4990: FOR cnt IN t_bb.FIRST .. t_bb.LAST
4991: LOOP
4992: --if g_debug then
4993: -- hr_utility.set_location('Processing '||l_proc, 130);
4994: --end if;
4995:
4996: -- Intitialise timecard scope variables
4997: IF (t_bb (cnt).time_bb_id <> l_old_timecard_bb_id)
4998: THEN
4999: -- set old time card id and reset copied flag
5000:
5001: --if g_debug then
5002: -- hr_utility.trace('GAZ t bb is '||to_char(t_bb(cnt).time_bb_id));
5003: --end if;
5004: l_timecard_retrieve := TRUE;
5005: l_day_retrieve := TRUE;
5006: l_old_timecard_bb_id := t_bb (cnt).time_bb_id;
5019: t_time_bld_blk_info.DELETE;
5020: END IF; -- timecard id changed check
5021:
5022: -- if g_debug then
5023: --hr_utility.set_location('Processing '||l_proc, 140);
5024: --end if;
5025:
5026: -- Initialise and maintain DAY scope variables
5027: IF (t_bb (cnt).day_bb_id <> l_old_day_bb_id)
5033: t_day_bld_blk_info.DELETE;
5034: END IF;
5035:
5036: -- if g_debug then
5037: --hr_utility.set_location('Processing '||l_proc, 160);
5038: --end if;
5039:
5040: -- Maintain Detail building blocks
5041: IF (t_bb (cnt).detail_bb_id <> l_old_detail_bb_id)
5042: THEN
5043: -- set count and old time card id
5044:
5045: -- if g_debug then
5046: --hr_utility.trace('GAZ tbb DETAIL is '||to_char(t_bb(cnt).detail_bb_id));
5047: --end if;
5048: l_old_detail_bb_id := t_bb (cnt).detail_bb_id;
5049: l_detail_copied := 'N';
5050: l_already_multiplied := 'N'; --DAYS Vs HOURS
5078: g_retrieval_process_id ) )
5079: THEN
5080: IF g_debug
5081: THEN
5082: hr_utility.trace('Resource '||t_bb (cnt).detail_resource_id||
5083: 'had a different rules evaluation pref and needs adj this time');
5084: END IF;
5085: END IF;
5086:
5085: END IF;
5086:
5087:
5088: ELSE
5089: hr_utility.TRACE ('about to call chk retrieve');
5090: hxc_generic_retrieval_utils.chk_retrieve
5091: (p_resource_id => t_bb (cnt).detail_resource_id,
5092: p_bb_status => t_bb (cnt).detail_approval_status,
5093: p_bb_deleted => t_bb (cnt).time_deleted,
5106: p_tc_locked => l_tc_locked,
5107: p_tc_first_lock => l_tc_first_lock,
5108: p_bb_skipped_reason => l_bb_skipped_reason
5109: );
5110: hr_utility.TRACE ('after to call chk retrieve');
5111: END IF; -- chk deleted and not transferred
5112:
5113: -- if this detail block has not already been copied and the object version numbers
5114: -- are different then we need this building block and the day and time bld blks
5294: END IF;
5295:
5296: IF g_debug
5297: THEN
5298: hr_utility.TRACE (' *********** - GLOBAL TABLE INFO ************ ');
5299: END IF;
5300:
5301: l_count := hxc_generic_retrieval_pkg.t_detail_bld_blks.COUNT;
5302:
5301: l_count := hxc_generic_retrieval_pkg.t_detail_bld_blks.COUNT;
5302:
5303: IF g_debug
5304: THEN
5305: hr_utility.TRACE ('DETAIL bld blks : ' || TO_CHAR (l_count));
5306: END IF;
5307:
5308: l_count := hxc_generic_retrieval_pkg.t_detail_attributes.COUNT;
5309:
5308: l_count := hxc_generic_retrieval_pkg.t_detail_attributes.COUNT;
5309:
5310: IF g_debug
5311: THEN
5312: hr_utility.TRACE ('DETAIL attributes : ' || TO_CHAR (l_count));
5313: END IF;
5314:
5315: l_count := hxc_generic_retrieval_pkg.t_tx_detail_bb_id.COUNT;
5316:
5315: l_count := hxc_generic_retrieval_pkg.t_tx_detail_bb_id.COUNT;
5316:
5317: IF g_debug
5318: THEN
5319: hr_utility.TRACE ('DETAIL txd count is ' || TO_CHAR (l_count));
5320: END IF;
5321:
5322: l_count := hxc_generic_retrieval_pkg.t_tx_error_bb_id.COUNT;
5323:
5322: l_count := hxc_generic_retrieval_pkg.t_tx_error_bb_id.COUNT;
5323:
5324: IF g_debug
5325: THEN
5326: hr_utility.TRACE ('ERROR txd count is ' || TO_CHAR (l_count));
5327: END IF;
5328:
5329: -- delete the table
5330: t_bb.DELETE;
5330: t_bb.DELETE;
5331:
5332: IF g_debug
5333: THEN
5334: hr_utility.set_location ('Leaving ' || l_proc, 200);
5335: END IF;
5336: EXCEPTION
5337: WHEN e_no_timecards
5338: THEN
5680:
5681: IF g_debug
5682: THEN
5683: l_proc := g_package || 'query_old_timecard';
5684: hr_utility.set_location ('Processing ' || l_proc, 180);
5685: END IF;
5686:
5687: IF (l_index <> 0)
5688: THEN
5703: );
5704:
5705: IF g_debug
5706: THEN
5707: hr_utility.set_location ('Processing ' || l_proc, 190);
5708: END IF;
5709:
5710: OPEN csr_get_old_detail_bld_blks;
5711:
5720: CLOSE csr_get_old_detail_bld_blks;
5721:
5722: IF g_debug
5723: THEN
5724: hr_utility.set_location ('Processing ' || l_proc, 200);
5725: END IF;
5726:
5727: OPEN csr_get_old_attributes;
5728:
5743: CLOSE csr_get_old_attributes;
5744:
5745: IF g_debug
5746: THEN
5747: hr_utility.set_location ( 'gaz - old att table is '
5748: || TO_CHAR (t_old_att_bb_id.COUNT),
5749: 999
5750: );
5751: END IF;
5771:
5772: -- populate old bld blk PL/SQL table
5773: IF g_debug
5774: THEN
5775: hr_utility.set_location ('Processing ' || l_proc, 210);
5776: END IF;
5777: l_detail_index := l_lower_range-1; --DAYS Vs HOURS
5778: l_bb_index := l_lower_range;
5779:
5805: END LOOP;
5806:
5807: IF g_debug
5808: THEN
5809: hr_utility.set_location ('Processing ' || l_proc, 220);
5810: END IF;
5811:
5812: l_index := hxc_generic_retrieval_pkg.t_old_detail_bld_blks.COUNT;
5813:
5812: l_index := hxc_generic_retrieval_pkg.t_old_detail_bld_blks.COUNT;
5813:
5814: IF g_debug
5815: THEN
5816: hr_utility.set_location
5817: ( 'gaz GLOBAL old DETAIL bld blk count is '
5818: || TO_CHAR (l_index),
5819: 999
5820: );
5823: l_index := hxc_generic_retrieval_pkg.t_old_detail_attributes.COUNT;
5824:
5825: IF g_debug
5826: THEN
5827: hr_utility.set_location ( 'gaz time att count is '
5828: || TO_CHAR (l_index),
5829: 999
5830: );
5831: END IF;
5833: IF (t_old_att_bb_id.COUNT <> 0)
5834: THEN
5835: IF g_debug
5836: THEN
5837: hr_utility.set_location ('Processing ' || l_proc, 230);
5838: END IF;
5839:
5840: FOR x IN t_old_att_bb_id.FIRST .. t_old_att_bb_id.LAST
5841: LOOP
5916: l_index := hxc_generic_retrieval_pkg.t_bb.COUNT;
5917:
5918: IF g_debug
5919: THEN
5920: hr_utility.set_location ( 'gaz t bb count is '
5921: || TO_CHAR (l_index),
5922: 999
5923: );
5924: END IF;
5924: END IF;
5925:
5926: IF g_debug
5927: THEN
5928: hr_utility.set_location ('Processing ' || l_proc, 240);
5929: END IF;
5930:
5931: FOR x IN t_bb.FIRST .. t_bb.LAST
5932: LOOP
5941: END IF; -- ( t_old_att_bb_id.COUNT <> 0 )
5942:
5943: IF g_debug
5944: THEN
5945: hr_utility.set_location ('Processing ' || l_proc, 250);
5946: END IF;
5947:
5948: -- truncate temporary tables and delete arrays and table
5949: t_bb.DELETE;
6002: END LOOP; -- while l_lower_range <= t_old_detail_bb_id.LAST
6003:
6004: IF g_debug
6005: THEN
6006: hr_utility.set_location ('Processing ' || l_proc, 260);
6007: END IF;
6008: END IF; -- IF ( l_index <> 0 )
6009: --if g_debug then
6010: -- hr_utility.set_location('Processing '||l_proc, 270);
6006: hr_utility.set_location ('Processing ' || l_proc, 260);
6007: END IF;
6008: END IF; -- IF ( l_index <> 0 )
6009: --if g_debug then
6010: -- hr_utility.set_location('Processing '||l_proc, 270);
6011: --end if;
6012: END query_old_timecard;
6013:
6014: --
6677: l_dummy VARCHAR2 (20);
6678: BEGIN -- check concurrency ok
6679: IF g_debug
6680: THEN
6681: hr_utility.TRACE ( 'in check concurrency - process id is '
6682: || TO_CHAR (p_process_id)
6683: );
6684: hr_utility.TRACE ( 'in check concurrency - retrieval id is '
6685: || p_retrieval_process
6680: THEN
6681: hr_utility.TRACE ( 'in check concurrency - process id is '
6682: || TO_CHAR (p_process_id)
6683: );
6684: hr_utility.TRACE ( 'in check concurrency - retrieval id is '
6685: || p_retrieval_process
6686: );
6687: hr_utility.TRACE ( 'in check concurrency - where clause is '
6688: || SUBSTR (p_where_clause, 1, 300)
6683: );
6684: hr_utility.TRACE ( 'in check concurrency - retrieval id is '
6685: || p_retrieval_process
6686: );
6687: hr_utility.TRACE ( 'in check concurrency - where clause is '
6688: || SUBSTR (p_where_clause, 1, 300)
6689: );
6690: END IF;
6691:
6699: -- if another process is running check to see if the transfer batch size is
6700: -- set otherwise the processes will conflict
6701: IF g_debug
6702: THEN
6703: hr_utility.TRACE ('l running is ' || TO_CHAR (l_transaction_id));
6704: END IF;
6705:
6706: IF (p_retrieval_process = 'Projects Retrieval Process')
6707: THEN
6715: )
6716: THEN
6717: IF g_debug
6718: THEN
6719: hr_utility.TRACE ('Checking BEE');
6720: END IF;
6721:
6722: -- make sure that ranges have been inserted already by the IN PROGRESS
6723: -- process
6724: WHILE l_no_ranges
6725: LOOP
6726: IF g_debug
6727: THEN
6728: hr_utility.TRACE ('looking for ranges');
6729: END IF;
6730:
6731: OPEN csr_chk_range_exists (l_transaction_id);
6732:
6736: IF (csr_chk_range_exists%NOTFOUND)
6737: THEN
6738: IF g_debug
6739: THEN
6740: hr_utility.TRACE ( 'No ranges yet for '
6741: || TO_CHAR (l_transaction_id)
6742: );
6743: END IF;
6744:
6752: END IF;
6753: ELSE
6754: IF g_debug
6755: THEN
6756: hr_utility.TRACE ('found ranges');
6757: END IF;
6758:
6759: l_no_ranges := FALSE;
6760: END IF;
6773: CLOSE csr_chk_where_clause;
6774:
6775: IF g_debug
6776: THEN
6777: hr_utility.TRACE ('l bee ok is ' || l_bee_ok);
6778: END IF;
6779: END IF;
6780:
6781: IF ( ( l_transaction_id IS NOT NULL
6786: )
6787: THEN
6788: IF g_debug
6789: THEN
6790: hr_utility.TRACE ('FALSE');
6791: END IF;
6792:
6793: RETURN FALSE;
6794: ELSE
6793: RETURN FALSE;
6794: ELSE
6795: IF g_debug
6796: THEN
6797: hr_utility.TRACE ('TRUE');
6798: END IF;
6799:
6800: RETURN TRUE;
6801: END IF;
6828: l_end_date DATE := NVL (p_end_date, hr_general.end_of_time);
6829: BEGIN
6830: IF g_debug
6831: THEN
6832: hr_utility.TRACE ('Entering chk_a_and_r_overlap');
6833: END IF;
6834:
6835: OPEN chk_a_and_r_overlap (l_start_date, l_end_date);
6836:
6847: CLOSE chk_a_and_r_overlap;
6848:
6849: IF g_debug
6850: THEN
6851: hr_utility.TRACE ('Leaving chk_a_and_r_overlap');
6852: END IF;
6853: END check_a_and_r_overlap;
6854:
6855: -- private procedure
6892: BEGIN -- get field mappings
6893: IF g_debug
6894: THEN
6895: l_proc := g_package || 'get_field_mappings';
6896: hr_utility.set_location ('Entering ' || l_proc, 10);
6897: END IF;
6898:
6899: OPEN csr_get_mappings;
6900:
6911:
6912: LOOP
6913: IF g_debug
6914: THEN
6915: hr_utility.set_location ('Processing ' || l_proc, 20);
6916: END IF;
6917:
6918: l_table_index := l_table_index + 1;
6919: l_mappings_table (l_table_index) := l_mapping_record;
6927: CLOSE csr_get_mappings;
6928:
6929: IF g_debug
6930: THEN
6931: hr_utility.set_location ('Leaving ' || l_proc, 30);
6932: END IF;
6933:
6934: RETURN l_mappings_table;
6935: END get_field_mappings;
6940: g_conc_request_id := fnd_profile.VALUE ('CONC_REQUEST_ID');
6941:
6942: IF g_debug
6943: THEN
6944: hr_utility.TRACE ('Conc Req ID is ' || TO_CHAR (g_conc_request_id)
6945: );
6946: END IF;
6947:
6948: fnd_file.put_line(fnd_file.log, fnd_date.date_to_canonical(SYSDATE)
7076: END get_valid_app_sets;
7077: BEGIN -- execute retrieval process
7078: -- this is to handle the case where the OTLR and BEE are processed in
7079: -- the loop
7080: g_debug := hr_utility.debug_enabled;
7081:
7082: IF ( g_params.p_process <> p_process
7083: AND hxc_generic_retrieval_pkg.g_in_loop
7084: )
7144: END IF;
7145:
7146: IF g_debug
7147: THEN
7148: hr_utility.TRACE ( 'final since date is '
7149: || TO_CHAR (g_params.since_date,
7150: 'hh24:mi:ss dd-mon-yy'
7151: )
7152: );
7223: glb_debug := TRUE;
7224:
7225: IF g_debug
7226: THEN
7227: hr_utility.trace_on
7228: (trace_mode => NULL,
7229: session_identifier => NVL
7230: (p_transaction_code,
7231: 'RETRIEVAL'
7235: END IF;
7236:
7237: IF g_debug
7238: THEN
7239: hr_utility.set_location ('Entering ' || l_proc, 10);
7240: END IF;
7241:
7242: IF ( g_params.p_transaction_code LIKE 'GAZ%'
7243: OR g_params.p_transaction_code IS NULL
7250: END IF;
7251:
7252: IF g_debug
7253: THEN
7254: hr_utility.TRACE ('**** Retrieval Params are.... ****');
7255: hr_utility.TRACE ('');
7256: hr_utility.TRACE ('Process is :' || g_params.p_process);
7257: hr_utility.TRACE ( 'Transaction code is :'
7258: || g_params.p_transaction_code
7251:
7252: IF g_debug
7253: THEN
7254: hr_utility.TRACE ('**** Retrieval Params are.... ****');
7255: hr_utility.TRACE ('');
7256: hr_utility.TRACE ('Process is :' || g_params.p_process);
7257: hr_utility.TRACE ( 'Transaction code is :'
7258: || g_params.p_transaction_code
7259: );
7252: IF g_debug
7253: THEN
7254: hr_utility.TRACE ('**** Retrieval Params are.... ****');
7255: hr_utility.TRACE ('');
7256: hr_utility.TRACE ('Process is :' || g_params.p_process);
7257: hr_utility.TRACE ( 'Transaction code is :'
7258: || g_params.p_transaction_code
7259: );
7260: hr_utility.TRACE ('Start Date is :' || g_params.p_start_date);
7253: THEN
7254: hr_utility.TRACE ('**** Retrieval Params are.... ****');
7255: hr_utility.TRACE ('');
7256: hr_utility.TRACE ('Process is :' || g_params.p_process);
7257: hr_utility.TRACE ( 'Transaction code is :'
7258: || g_params.p_transaction_code
7259: );
7260: hr_utility.TRACE ('Start Date is :' || g_params.p_start_date);
7261: hr_utility.TRACE ('End Date is :' || g_params.p_end_date);
7256: hr_utility.TRACE ('Process is :' || g_params.p_process);
7257: hr_utility.TRACE ( 'Transaction code is :'
7258: || g_params.p_transaction_code
7259: );
7260: hr_utility.TRACE ('Start Date is :' || g_params.p_start_date);
7261: hr_utility.TRACE ('End Date is :' || g_params.p_end_date);
7262: hr_utility.TRACE ('Incremental is :'
7263: || g_params.p_incremental
7264: );
7257: hr_utility.TRACE ( 'Transaction code is :'
7258: || g_params.p_transaction_code
7259: );
7260: hr_utility.TRACE ('Start Date is :' || g_params.p_start_date);
7261: hr_utility.TRACE ('End Date is :' || g_params.p_end_date);
7262: hr_utility.TRACE ('Incremental is :'
7263: || g_params.p_incremental
7264: );
7265: hr_utility.TRACE ('Rerun Flag is :' || g_params.p_rerun_flag);
7258: || g_params.p_transaction_code
7259: );
7260: hr_utility.TRACE ('Start Date is :' || g_params.p_start_date);
7261: hr_utility.TRACE ('End Date is :' || g_params.p_end_date);
7262: hr_utility.TRACE ('Incremental is :'
7263: || g_params.p_incremental
7264: );
7265: hr_utility.TRACE ('Rerun Flag is :' || g_params.p_rerun_flag);
7266: hr_utility.TRACE ( 'Where Clause is :'
7261: hr_utility.TRACE ('End Date is :' || g_params.p_end_date);
7262: hr_utility.TRACE ('Incremental is :'
7263: || g_params.p_incremental
7264: );
7265: hr_utility.TRACE ('Rerun Flag is :' || g_params.p_rerun_flag);
7266: hr_utility.TRACE ( 'Where Clause is :'
7267: || SUBSTR (g_params.p_where_clause, 1, 200)
7268: );
7269: hr_utility.TRACE (SUBSTR (g_params.p_where_clause, 201, 200));
7262: hr_utility.TRACE ('Incremental is :'
7263: || g_params.p_incremental
7264: );
7265: hr_utility.TRACE ('Rerun Flag is :' || g_params.p_rerun_flag);
7266: hr_utility.TRACE ( 'Where Clause is :'
7267: || SUBSTR (g_params.p_where_clause, 1, 200)
7268: );
7269: hr_utility.TRACE (SUBSTR (g_params.p_where_clause, 201, 200));
7270: hr_utility.TRACE (SUBSTR (g_params.p_where_clause, 401, 200));
7265: hr_utility.TRACE ('Rerun Flag is :' || g_params.p_rerun_flag);
7266: hr_utility.TRACE ( 'Where Clause is :'
7267: || SUBSTR (g_params.p_where_clause, 1, 200)
7268: );
7269: hr_utility.TRACE (SUBSTR (g_params.p_where_clause, 201, 200));
7270: hr_utility.TRACE (SUBSTR (g_params.p_where_clause, 401, 200));
7271: hr_utility.TRACE ('Scope is :' || g_params.p_scope);
7272: hr_utility.TRACE ('Clusive is :' || g_params.p_clusive);
7273: hr_utility.TRACE ('');
7266: hr_utility.TRACE ( 'Where Clause is :'
7267: || SUBSTR (g_params.p_where_clause, 1, 200)
7268: );
7269: hr_utility.TRACE (SUBSTR (g_params.p_where_clause, 201, 200));
7270: hr_utility.TRACE (SUBSTR (g_params.p_where_clause, 401, 200));
7271: hr_utility.TRACE ('Scope is :' || g_params.p_scope);
7272: hr_utility.TRACE ('Clusive is :' || g_params.p_clusive);
7273: hr_utility.TRACE ('');
7274: hr_utility.TRACE ('**** Retrieval LOOPING GLOBALS are.... ****');
7267: || SUBSTR (g_params.p_where_clause, 1, 200)
7268: );
7269: hr_utility.TRACE (SUBSTR (g_params.p_where_clause, 201, 200));
7270: hr_utility.TRACE (SUBSTR (g_params.p_where_clause, 401, 200));
7271: hr_utility.TRACE ('Scope is :' || g_params.p_scope);
7272: hr_utility.TRACE ('Clusive is :' || g_params.p_clusive);
7273: hr_utility.TRACE ('');
7274: hr_utility.TRACE ('**** Retrieval LOOPING GLOBALS are.... ****');
7275: END IF;
7268: );
7269: hr_utility.TRACE (SUBSTR (g_params.p_where_clause, 201, 200));
7270: hr_utility.TRACE (SUBSTR (g_params.p_where_clause, 401, 200));
7271: hr_utility.TRACE ('Scope is :' || g_params.p_scope);
7272: hr_utility.TRACE ('Clusive is :' || g_params.p_clusive);
7273: hr_utility.TRACE ('');
7274: hr_utility.TRACE ('**** Retrieval LOOPING GLOBALS are.... ****');
7275: END IF;
7276:
7269: hr_utility.TRACE (SUBSTR (g_params.p_where_clause, 201, 200));
7270: hr_utility.TRACE (SUBSTR (g_params.p_where_clause, 401, 200));
7271: hr_utility.TRACE ('Scope is :' || g_params.p_scope);
7272: hr_utility.TRACE ('Clusive is :' || g_params.p_clusive);
7273: hr_utility.TRACE ('');
7274: hr_utility.TRACE ('**** Retrieval LOOPING GLOBALS are.... ****');
7275: END IF;
7276:
7277: IF (g_in_loop)
7270: hr_utility.TRACE (SUBSTR (g_params.p_where_clause, 401, 200));
7271: hr_utility.TRACE ('Scope is :' || g_params.p_scope);
7272: hr_utility.TRACE ('Clusive is :' || g_params.p_clusive);
7273: hr_utility.TRACE ('');
7274: hr_utility.TRACE ('**** Retrieval LOOPING GLOBALS are.... ****');
7275: END IF;
7276:
7277: IF (g_in_loop)
7278: THEN
7277: IF (g_in_loop)
7278: THEN
7279: IF g_debug
7280: THEN
7281: hr_utility.TRACE ('G_IN_LOOP is TRUE');
7282: END IF;
7283: ELSE
7284: IF g_debug
7285: THEN
7282: END IF;
7283: ELSE
7284: IF g_debug
7285: THEN
7286: hr_utility.TRACE ('G_IN_LOOP is FALSE');
7287: END IF;
7288: END IF;
7289:
7290: IF (g_last_chunk)
7290: IF (g_last_chunk)
7291: THEN
7292: IF g_debug
7293: THEN
7294: hr_utility.TRACE ('G_LAST_CHUNK is TRUE');
7295: END IF;
7296: ELSE
7297: IF g_debug
7298: THEN
7295: END IF;
7296: ELSE
7297: IF g_debug
7298: THEN
7299: hr_utility.TRACE ('G_LAST_CHUNK is FALSE');
7300: END IF;
7301: END IF;
7302:
7303: IF (g_no_timecards)
7303: IF (g_no_timecards)
7304: THEN
7305: IF g_debug
7306: THEN
7307: hr_utility.TRACE ('G_NO_TIMECARDS is TRUE');
7308: END IF;
7309: ELSE
7310: IF g_debug
7311: THEN
7308: END IF;
7309: ELSE
7310: IF g_debug
7311: THEN
7312: hr_utility.TRACE ('G_NO_TIMECARDS is FALSE');
7313: END IF;
7314: END IF;
7315:
7316: IF (g_overall_no_timecards)
7316: IF (g_overall_no_timecards)
7317: THEN
7318: IF g_debug
7319: THEN
7320: hr_utility.TRACE ('G_OVERALL_NO_TIMECARDS is TRUE');
7321: END IF;
7322: ELSE
7323: IF g_debug
7324: THEN
7321: END IF;
7322: ELSE
7323: IF g_debug
7324: THEN
7325: hr_utility.TRACE ('G_OVERALL_NO_TIMECARDS is FALSE');
7326: END IF;
7327: END IF;
7328:
7329: IF g_debug
7327: END IF;
7328:
7329: IF g_debug
7330: THEN
7331: hr_utility.TRACE ( 'l_range_start is '
7332: || TO_CHAR (l_pkg_range_start)
7333: );
7334: hr_utility.TRACE ('l_range_stop is ' || TO_CHAR (l_pkg_range_stop));
7335: END IF;
7330: THEN
7331: hr_utility.TRACE ( 'l_range_start is '
7332: || TO_CHAR (l_pkg_range_start)
7333: );
7334: hr_utility.TRACE ('l_range_stop is ' || TO_CHAR (l_pkg_range_stop));
7335: END IF;
7336:
7337: IF (NOT hxc_generic_retrieval_pkg.g_in_loop)
7338: THEN
7346: );
7347:
7348: IF g_debug
7349: THEN
7350: hr_utility.set_location ('Processing ' || l_proc, 20);
7351: END IF;
7352:
7353: -- check to see if mapping_id exists and thus retrieval process registered
7354: IF (l_mapping_id IS NULL)
7359: -- now check to see if this retrieval is already running
7360: -- only need to do this if NOT the 'Projects Retrieval Process'
7361: IF g_debug
7362: THEN
7363: hr_utility.set_location ('Processing ' || l_proc, 30);
7364: END IF;
7365:
7366: IF (g_params.p_process = 'Apply Schedule Rules')
7367: THEN
7457: );
7458:
7459: IF g_debug
7460: THEN
7461: hr_utility.set_location ('Processing ' || l_proc, 40);
7462: END IF;
7463:
7464: IF NOT hxc_generic_retrieval_pkg.g_in_loop
7465: THEN
7494: l_where_clause_blk := replace_timecard_string (l_where_clause_blk);
7495:
7496: IF g_debug
7497: THEN
7498: hr_utility.set_location ('Processing ' || l_proc, 60);
7499: END IF;
7500:
7501: l_dynamic_query :=
7502: build_query (p_where_clause_blk => l_where_clause_blk,
7504: );
7505:
7506: IF g_debug
7507: THEN
7508: hr_utility.set_location ('Processing ' || l_proc, 70);
7509: END IF;
7510:
7511: -- lets see the query
7512: insert_query (l_dynamic_query, 'QUERY');
7519: IF (hxc_generic_retrieval_pkg.g_in_loop)
7520: THEN
7521: IF g_debug
7522: THEN
7523: hr_utility.set_location ('Processing ' || l_proc, 71);
7524: END IF;
7525:
7526: WHILE (hxc_generic_retrieval_pkg.g_no_timecards)
7527: LOOP
7526: WHILE (hxc_generic_retrieval_pkg.g_no_timecards)
7527: LOOP
7528: IF g_debug
7529: THEN
7530: hr_utility.set_location ('Processing ' || l_proc, 72);
7531: END IF;
7532:
7533: BEGIN
7534: query_it (p_query => l_dynamic_query);
7536: WHEN OTHERS
7537: THEN
7538: IF g_debug
7539: THEN
7540: hr_utility.TRACE ( 'query EXCEPTION is '
7541: || SUBSTR (SQLERRM, 1, 60)
7542: );
7543: hr_utility.TRACE ( 'query EXCEPTION is '
7544: || SUBSTR (SQLERRM, 61, 120)
7539: THEN
7540: hr_utility.TRACE ( 'query EXCEPTION is '
7541: || SUBSTR (SQLERRM, 1, 60)
7542: );
7543: hr_utility.TRACE ( 'query EXCEPTION is '
7544: || SUBSTR (SQLERRM, 61, 120)
7545: );
7546: hr_utility.TRACE ( 'query EXCEPTION is '
7547: || SUBSTR (SQLERRM, 121, 180)
7542: );
7543: hr_utility.TRACE ( 'query EXCEPTION is '
7544: || SUBSTR (SQLERRM, 61, 120)
7545: );
7546: hr_utility.TRACE ( 'query EXCEPTION is '
7547: || SUBSTR (SQLERRM, 121, 180)
7548: );
7549: hr_utility.TRACE ( 'query EXCEPTION is '
7550: || SUBSTR (SQLERRM, 181, 240)
7545: );
7546: hr_utility.TRACE ( 'query EXCEPTION is '
7547: || SUBSTR (SQLERRM, 121, 180)
7548: );
7549: hr_utility.TRACE ( 'query EXCEPTION is '
7550: || SUBSTR (SQLERRM, 181, 240)
7551: );
7552: END IF;
7553:
7560: )
7561: THEN
7562: IF g_debug
7563: THEN
7564: hr_utility.set_location ('Processing ' || l_proc,
7565: 73
7566: );
7567: END IF;
7568:
7576: )
7577: THEN
7578: IF g_debug
7579: THEN
7580: hr_utility.set_location ('Processing ' || l_proc,
7581: 74
7582: );
7583: END IF;
7584:
7586: )
7587: THEN
7588: IF g_debug
7589: THEN
7590: hr_utility.set_location ('Processing ' || l_proc,
7591: 75
7592: );
7593: END IF;
7594:
7603: END IF;
7604: ELSE
7605: IF g_debug
7606: THEN
7607: hr_utility.set_location ('Processing ' || l_proc,
7608: 76
7609: );
7610: END IF;
7611:
7625: END LOOP;
7626: ELSE
7627: IF g_debug
7628: THEN
7629: hr_utility.set_location ('Processing ' || l_proc, 77);
7630: END IF;
7631:
7632: query_it (p_query => l_dynamic_query);
7633: END IF;
7633: END IF;
7634:
7635: IF g_debug
7636: THEN
7637: hr_utility.set_location ('Processing ' || l_proc, 80);
7638: END IF;
7639:
7640: IF (NOT hxc_generic_retrieval_pkg.g_last_chunk)
7641: THEN
7646: END IF; -- IF ( NOT hxc_generic_retrieval_pkg.G_LAST_CHUNK )
7647:
7648: IF g_debug
7649: THEN
7650: hr_utility.set_location ('Processing ' || l_proc, 100);
7651: END IF;
7652: END IF;
7653:
7654: -- ( hxc_generic_retrieval_pkg.G_IN_LOOP AND hxc_generic_retrieval_pkg.G_LAST_CHUNK );
7836: l_boolean BOOLEAN;
7837: l_temp_transaction_id t_transaction_id;
7838: l_ranges_to_process number;
7839: BEGIN
7840: g_debug := hr_utility.debug_enabled;
7841:
7842: IF g_debug
7843: THEN
7844: l_proc := g_package || 'update_transaction_status';
7841:
7842: IF g_debug
7843: THEN
7844: l_proc := g_package || 'update_transaction_status';
7845: hr_utility.TRACE ('In Update Transaction Status');
7846: END IF;
7847:
7848: -- get the process id
7849: chk_retrieval_process (p_retrieval_process => p_process,
7854:
7855: -- now call the audit transaction appropriately
7856: IF g_debug
7857: THEN
7858: hr_utility.set_location ('Processing ' || l_proc, 110);
7859: END IF;
7860:
7861: -- Bug 6914381
7862: -- If any transaction resulted in error, there is no need to
7925: IF NOT p_rollback
7926: THEN
7927: IF g_debug
7928: THEN
7929: hr_utility.set_location ('Processing ' || l_proc, 130);
7930: END IF;
7931:
7932: -- check to see if any tx time details
7933: IF l_time_max <> 0
7944: l_temp_transaction_id;
7945:
7946: IF g_debug
7947: THEN
7948: hr_utility.set_location ('Processing ' || l_proc, 50);
7949: END IF;
7950:
7951: FORALL tx_detail IN hxc_generic_retrieval_pkg.t_tx_time_transaction_id.FIRST .. hxc_generic_retrieval_pkg.t_tx_time_transaction_id.LAST
7952: INSERT INTO hxc_transaction_details
7986: l_temp_transaction_id;
7987:
7988: IF g_debug
7989: THEN
7990: hr_utility.set_location ('Processing ' || l_proc, 60);
7991: END IF;
7992:
7993: FORALL tx_detail IN hxc_generic_retrieval_pkg.t_tx_day_transaction_id.FIRST .. hxc_generic_retrieval_pkg.t_tx_day_transaction_id.LAST
7994: INSERT INTO hxc_transaction_details
8028: l_temp_transaction_id;
8029:
8030: IF g_debug
8031: THEN
8032: hr_utility.set_location ('Processing ' || l_proc, 70);
8033: END IF;
8034:
8035: FORALL tx_detail IN hxc_generic_retrieval_pkg.t_tx_detail_transaction_id.FIRST .. hxc_generic_retrieval_pkg.t_tx_detail_transaction_id.LAST
8036: INSERT INTO hxc_transaction_details
8055: );
8056:
8057: IF g_debug
8058: THEN
8059: hr_utility.set_location ('Processing ' || l_proc, 75);
8060: END IF;
8061: END IF; -- l_detail_max <> 0
8062:
8063: IF g_debug
8061: END IF; -- l_detail_max <> 0
8062:
8063: IF g_debug
8064: THEN
8065: hr_utility.set_location ('Processing ' || l_proc, 80);
8066: END IF;
8067:
8068: IF l_error_max <> 0
8069: THEN
8068: IF l_error_max <> 0
8069: THEN
8070: IF g_debug
8071: THEN
8072: hr_utility.set_location ('Processing ' || l_proc, 85);
8073: END IF;
8074:
8075: -- now let's bulk fetch all the transaction detail id
8076: OPEN csr_get_tx_detail_id (l_error_max);
8084: l_temp_transaction_id;
8085:
8086: IF g_debug
8087: THEN
8088: hr_utility.set_location ('Processing ' || l_proc, 90);
8089: END IF;
8090:
8091: FORALL tx_error IN hxc_generic_retrieval_pkg.t_tx_error_transaction_id.FIRST .. hxc_generic_retrieval_pkg.t_tx_error_transaction_id.LAST
8092: INSERT INTO hxc_transaction_details
8118: hxc_generic_retrieval_pkg.t_tx_error_exception.DELETE;
8119:
8120: IF g_debug
8121: THEN
8122: hr_utility.set_location ('Processing ' || l_proc, 100);
8123: END IF;
8124: END IF; -- l_error_max <> 0
8125: END IF; -- p_rollback
8126:
8125: END IF; -- p_rollback
8126:
8127: IF g_debug
8128: THEN
8129: hr_utility.set_location ('Processing ' || l_proc, 170);
8130: END IF;
8131:
8132: -- need to clean up the hxc retrieval ranges table if the process
8133: -- has errored.
8153: -- DO NOT DELETE FOR 'IN PROGRESS' TRANSACTIONS
8154: THEN
8155: IF g_debug
8156: THEN
8157: hr_utility.TRACE ('g_conc_request_id is ' || g_conc_request_id);
8158: END IF;
8159:
8160: delete_retrieval_ranges (hxc_generic_retrieval_pkg.g_transaction_id);
8161:
8160: delete_retrieval_ranges (hxc_generic_retrieval_pkg.g_transaction_id);
8161:
8162: IF g_debug
8163: THEN
8164: hr_utility.set_location ('Processing ' || l_proc, 200);
8165: END IF;
8166: ELSE
8167: IF g_debug
8168: THEN
8165: END IF;
8166: ELSE
8167: IF g_debug
8168: THEN
8169: hr_utility.set_location ('Processing ' || l_proc, 250);
8170: END IF;
8171: END IF;
8172:
8173: IF (hxc_generic_retrieval_utils.chk_terminated
8255: END IF;
8256:
8257: IF g_debug
8258: THEN
8259: hr_utility.TRACE ('Leaving Update Transaction Status');
8260: END IF;
8261: END update_transaction_status;
8262: END hxc_generic_retrieval_pkg;