141:
142: -- Derive Federal School Code.
143: igf_sl_gen.get_stu_fao_code(l_get_base_id_rec.base_id, 'FED_SCH_CD', x_fed_sch_cd, x_return_status, x_msg_data);
144: IF (x_return_status = 'E') THEN
145: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
146: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, 'igf.plsql.igf_ap_isir_import_pkg.l_is_cor_from_same_school.debug','x_msg_data : ' || x_msg_data);
147: END IF;
148: RETURN FALSE;
149: ELSE
142: -- Derive Federal School Code.
143: igf_sl_gen.get_stu_fao_code(l_get_base_id_rec.base_id, 'FED_SCH_CD', x_fed_sch_cd, x_return_status, x_msg_data);
144: IF (x_return_status = 'E') THEN
145: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
146: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, 'igf.plsql.igf_ap_isir_import_pkg.l_is_cor_from_same_school.debug','x_msg_data : ' || x_msg_data);
147: END IF;
148: RETURN FALSE;
149: ELSE
150: -- write debug message with federal school code.
147: END IF;
148: RETURN FALSE;
149: ELSE
150: -- write debug message with federal school code.
151: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
152: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, 'igf.plsql.igf_ap_isir_import_pkg.l_is_cor_from_same_school.debug','x_fed_sch_cd : ' || x_fed_sch_cd);
153: END IF;
154: -- check wether federal school code matches with any of 6 codes
155: IF ( x_fed_sch_cd = l_get_base_id_rec.first_college OR
148: RETURN FALSE;
149: ELSE
150: -- write debug message with federal school code.
151: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
152: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, 'igf.plsql.igf_ap_isir_import_pkg.l_is_cor_from_same_school.debug','x_fed_sch_cd : ' || x_fed_sch_cd);
153: END IF;
154: -- check wether federal school code matches with any of 6 codes
155: IF ( x_fed_sch_cd = l_get_base_id_rec.first_college OR
156: x_fed_sch_cd = l_get_base_id_rec.second_college OR
288: fnd_message.set_token('SPAWN_ID', p_sub_req_number);
289: fnd_file.put_line( fnd_file.LOG ,fnd_message.get);
290: END IF;
291:
292: IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
293: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.spawn_processes.debug','Launched spawned request ' || p_sub_req_number || ' Request ID : ' || l_request_id);
294: END IF;
295:
296: EXCEPTION
289: fnd_file.put_line( fnd_file.LOG ,fnd_message.get);
290: END IF;
291:
292: IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
293: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.spawn_processes.debug','Launched spawned request ' || p_sub_req_number || ' Request ID : ' || l_request_id);
294: END IF;
295:
296: EXCEPTION
297: WHEN OTHERS THEN
294: END IF;
295:
296: EXCEPTION
297: WHEN OTHERS THEN
298: IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
299: fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_ap_isir_import_pkg.launch_sub_request.exception','The exception is : ' || SQLERRM );
300: END IF;
301:
302: fnd_message.set_name('IGS','IGS_GE_UNHANDLED_EXP');
295:
296: EXCEPTION
297: WHEN OTHERS THEN
298: IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
299: fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_ap_isir_import_pkg.launch_sub_request.exception','The exception is : ' || SQLERRM );
300: END IF;
301:
302: fnd_message.set_name('IGS','IGS_GE_UNHANDLED_EXP');
303: fnd_message.set_token('NAME','IGF_AP_ISIR_IMPORT_PKG.LAUNCH_SUB_REQUEST');
470: CLOSE cur_match_set;
471:
472: log_debug_message(' All validations successful... ');
473:
474: IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
475: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.validate_parameters.debug', 'Successfully Completed validate_parameters procedure.');
476: END IF;
477:
478: EXCEPTION
471:
472: log_debug_message(' All validations successful... ');
473:
474: IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
475: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.validate_parameters.debug', 'Successfully Completed validate_parameters procedure.');
476: END IF;
477:
478: EXCEPTION
479: WHEN OTHERS THEN
476: END IF;
477:
478: EXCEPTION
479: WHEN OTHERS THEN
480: IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
481: fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_ap_isir_import_pkg.validate_parameters.exception','The exception is : ' || SQLERRM );
482: END IF;
483:
484: fnd_message.set_name('IGS','IGS_GE_UNHANDLED_EXP');
477:
478: EXCEPTION
479: WHEN OTHERS THEN
480: IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
481: fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_ap_isir_import_pkg.validate_parameters.exception','The exception is : ' || SQLERRM );
482: END IF;
483:
484: fnd_message.set_name('IGS','IGS_GE_UNHANDLED_EXP');
485: fnd_message.set_token('NAME','IGF_AP_ISIR_IMPORT_PKG.VALIDATE_PARAMETERS');
562: g_where := g_where || ' AND ' || '''' || g_school_code || '''' || ' IN (first_college_cd, second_college_cd, third_college_cd, fourth_college_cd, fifth_college_cd, sixth_college_cd) ';
563: END IF;
564:
565: -- fnd_file.put_line(fnd_file.LOG, ' Dynamic Where Clause : ' || g_where);
566: IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
567: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.build_selection_criteria.debug', 'Successfully Completed build_selection_criteria procedure.');
568: END IF;
569:
570: EXCEPTION
563: END IF;
564:
565: -- fnd_file.put_line(fnd_file.LOG, ' Dynamic Where Clause : ' || g_where);
566: IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
567: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.build_selection_criteria.debug', 'Successfully Completed build_selection_criteria procedure.');
568: END IF;
569:
570: EXCEPTION
571: WHEN OTHERS THEN
568: END IF;
569:
570: EXCEPTION
571: WHEN OTHERS THEN
572: IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
573: fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_ap_isir_import_pkg.build_selection_criteria.exception','The exception is : ' || SQLERRM );
574: END IF;
575:
576: fnd_message.set_name('IGS','IGS_GE_UNHANDLED_EXP');
569:
570: EXCEPTION
571: WHEN OTHERS THEN
572: IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
573: fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_ap_isir_import_pkg.build_selection_criteria.exception','The exception is : ' || SQLERRM );
574: END IF;
575:
576: fnd_message.set_name('IGS','IGS_GE_UNHANDLED_EXP');
577: fnd_message.set_token('NAME','IGF_AP_ISIR_IMPORT_PKG.BUILD_SELECTION_CRITERIA');
601: i NUMBER := 1;
602:
603: BEGIN
604:
605: IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
606: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.query_isir_records.debug', 'Beginning procedure query_isir_records');
607: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.query_isir_records.debug', 'Querying SQL Query : ' || g_where);
608: END IF;
609:
602:
603: BEGIN
604:
605: IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
606: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.query_isir_records.debug', 'Beginning procedure query_isir_records');
607: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.query_isir_records.debug', 'Querying SQL Query : ' || g_where);
608: END IF;
609:
610: i := 1;
603: BEGIN
604:
605: IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
606: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.query_isir_records.debug', 'Beginning procedure query_isir_records');
607: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.query_isir_records.debug', 'Querying SQL Query : ' || g_where);
608: END IF;
609:
610: i := 1;
611: -- Execute the query and get the records into temp table.
637: -- get the count of No. of ISIR records for processing.
638: g_total_recs_fetched := g_si_id_tab.COUNT;
639: log_debug_message('Populated temporary PL/SQL table. Records : ' || g_total_recs_fetched || '. Time : ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH:MI:SS'));
640:
641: IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
642: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.query_isir_records.debug', 'No. of records fetched for processing : ' || g_total_recs_fetched);
643: END IF;
644:
645: EXCEPTION
638: g_total_recs_fetched := g_si_id_tab.COUNT;
639: log_debug_message('Populated temporary PL/SQL table. Records : ' || g_total_recs_fetched || '. Time : ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH:MI:SS'));
640:
641: IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
642: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.query_isir_records.debug', 'No. of records fetched for processing : ' || g_total_recs_fetched);
643: END IF;
644:
645: EXCEPTION
646: WHEN OTHERS THEN
643: END IF;
644:
645: EXCEPTION
646: WHEN OTHERS THEN
647: IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
648: fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_ap_isir_import_pkg.query_isir_records.exception','The exception is : ' || SQLERRM );
649: END IF;
650: log_debug_message('EXCEPTION : ' || SQLERRM);
651:
644:
645: EXCEPTION
646: WHEN OTHERS THEN
647: IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
648: fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_ap_isir_import_pkg.query_isir_records.exception','The exception is : ' || SQLERRM );
649: END IF;
650: log_debug_message('EXCEPTION : ' || SQLERRM);
651:
652: fnd_message.set_name('IGS','IGS_GE_UNHANDLED_EXP');
678:
679: BEGIN
680:
681: log_debug_message(' Beginning process spawning....');
682: IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
683: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.spawn_processes.debug', 'No. of processes to spawn : ' || p_spawn_process);
684: END IF;
685:
686: -- get the No. of records per process
679: BEGIN
680:
681: log_debug_message(' Beginning process spawning....');
682: IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
683: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.spawn_processes.debug', 'No. of processes to spawn : ' || p_spawn_process);
684: END IF;
685:
686: -- get the No. of records per process
687: l_recs_per_process := CEIL(g_total_recs_fetched/p_spawn_process);
724: -- update tracking variables.
725: l_to_rec := l_to_rec + 1;
726: l_current_sub_req_recs := l_current_sub_req_recs + 1;
727:
728: IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
729: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.spawn_processes.debug', 'Adding SI_ID ' || g_si_id_tab(l_to_rec) || ' to Sub Request No. ' || i);
730: END IF;
731: log_debug_message(' Next record belongs to same person!!!!. Including in the current sub reqeust itself. SI_ID ' || g_si_id_tab(l_to_rec));
732: END LOOP;
725: l_to_rec := l_to_rec + 1;
726: l_current_sub_req_recs := l_current_sub_req_recs + 1;
727:
728: IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
729: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.spawn_processes.debug', 'Adding SI_ID ' || g_si_id_tab(l_to_rec) || ' to Sub Request No. ' || i);
730: END IF;
731: log_debug_message(' Next record belongs to same person!!!!. Including in the current sub reqeust itself. SI_ID ' || g_si_id_tab(l_to_rec));
732: END LOOP;
733: END IF; -- g_proc_recs_tab
732: END LOOP;
733: END IF; -- g_proc_recs_tab
734:
735: log_debug_message('TOTAL RECORDS for Sub Request No. ' || i || ' is ' || l_current_sub_req_recs);
736: IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
737: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.spawn_processes.debug', 'Total records for Sub Request No. ' || i || ' is ' || l_current_sub_req_recs);
738: END IF;
739:
740: ----------------------------------------------------------------------------
733: END IF; -- g_proc_recs_tab
734:
735: log_debug_message('TOTAL RECORDS for Sub Request No. ' || i || ' is ' || l_current_sub_req_recs);
736: IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
737: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.spawn_processes.debug', 'Total records for Sub Request No. ' || i || ' is ' || l_current_sub_req_recs);
738: END IF;
739:
740: ----------------------------------------------------------------------------
741: -- At this point Final Recs to be processed for the current sub request have been included.
764: END IF;
765:
766: END LOOP; -- i
767:
768: IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
769: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.spawn_processes.debug', 'Completed updating Spawning Processes details.... ');
770: END IF;
771: log_debug_message(' Spawning Process completed successfully. Exitting.....at.. ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH:MI:SS'));
772:
765:
766: END LOOP; -- i
767:
768: IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
769: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.spawn_processes.debug', 'Completed updating Spawning Processes details.... ');
770: END IF;
771: log_debug_message(' Spawning Process completed successfully. Exitting.....at.. ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH:MI:SS'));
772:
773: EXCEPTION
771: log_debug_message(' Spawning Process completed successfully. Exitting.....at.. ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH:MI:SS'));
772:
773: EXCEPTION
774: WHEN OTHERS THEN
775: IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
776: fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_ap_isir_import_pkg.spawn_processes.exception','The exception is : ' || SQLERRM );
777: END IF;
778: log_debug_message(' EXCEPTION in spawn_processes : ' || SQLERRM);
779:
772:
773: EXCEPTION
774: WHEN OTHERS THEN
775: IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
776: fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_ap_isir_import_pkg.spawn_processes.exception','The exception is : ' || SQLERRM );
777: END IF;
778: log_debug_message(' EXCEPTION in spawn_processes : ' || SQLERRM);
779:
780: fnd_message.set_name('IGS','IGS_GE_UNHANDLED_EXP');
851: retcode := 0;
852: l_cal_type := LTRIM(RTRIM(SUBSTR(p_award_year,1,10)));
853: l_seq_number := TO_NUMBER(SUBSTR(p_award_year,11));
854:
855: IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
856: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.main_import_process.debug','Beginning Main process. Before gathering Statistics: ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH:MI:SS'));
857: END IF;
858:
859: -- gather Statistics RAMMOHAN commented for testing
852: l_cal_type := LTRIM(RTRIM(SUBSTR(p_award_year,1,10)));
853: l_seq_number := TO_NUMBER(SUBSTR(p_award_year,11));
854:
855: IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
856: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.main_import_process.debug','Beginning Main process. Before gathering Statistics: ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH:MI:SS'));
857: END IF;
858:
859: -- gather Statistics RAMMOHAN commented for testing
860: log_debug_message(' Starting to gather statistics. ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH:MI:SS'));
861: fnd_stats.gather_table_stats(ownname => 'IGF', tabname => 'IGF_AP_ISIR_INTS_ALL' , cascade => TRUE);
862: fnd_stats.gather_table_stats(ownname => 'IGF', tabname => 'IGF_AP_ISIR_MATCHED_ALL' , cascade => TRUE);
863: log_debug_message(' End of Statistics gathering. ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH:MI:SS'));
864:
865: IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
866: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.main_import_process.debug','After gathering Statistics: ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH:MI:SS'));
867: END IF;
868:
869:
862: fnd_stats.gather_table_stats(ownname => 'IGF', tabname => 'IGF_AP_ISIR_MATCHED_ALL' , cascade => TRUE);
863: log_debug_message(' End of Statistics gathering. ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH:MI:SS'));
864:
865: IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
866: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.main_import_process.debug','After gathering Statistics: ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH:MI:SS'));
867: END IF;
868:
869:
870: -- Copying the parameter values to the gobal variable.
953: launch_sub_request(p_sub_req_number => 1, p_sub_req_rec_cnt => g_total_recs_fetched);
954: END IF;
955:
956: log_debug_message('Successfully completed the Request at : ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH:MI:SS')) ;
957: IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
958: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.main_import_process.debug','Successfully Completed the process at: ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH:MI:SS'));
959: END IF;
960:
961: EXCEPTION
954: END IF;
955:
956: log_debug_message('Successfully completed the Request at : ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH:MI:SS')) ;
957: IF fnd_log.level_statement >= fnd_log.g_current_runtime_level THEN
958: fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_isir_import_pkg.main_import_process.debug','Successfully Completed the process at: ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH:MI:SS'));
959: END IF;
960:
961: EXCEPTION
962: WHEN others THEN