154: BEGIN -- assp_ins_admin_grds
155: --
156: IGS_GE_GEN_003.set_org_id(); -- swaghmar, bug# 4951054
157:
158: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
159: fnd_log.string (
160: fnd_log.level_procedure,
161: g_module_head || 'assp_ins_admin_grds.begin',
162: 'In Params : p_assess_calendar => ' || p_assess_calendar || ';' ||
155: --
156: IGS_GE_GEN_003.set_org_id(); -- swaghmar, bug# 4951054
157:
158: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
159: fnd_log.string (
160: fnd_log.level_procedure,
161: g_module_head || 'assp_ins_admin_grds.begin',
162: 'In Params : p_assess_calendar => ' || p_assess_calendar || ';' ||
163: 'p_teaching_calendar => ' || p_teaching_calendar || ';' ||
156: IGS_GE_GEN_003.set_org_id(); -- swaghmar, bug# 4951054
157:
158: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
159: fnd_log.string (
160: fnd_log.level_procedure,
161: g_module_head || 'assp_ins_admin_grds.begin',
162: 'In Params : p_assess_calendar => ' || p_assess_calendar || ';' ||
163: 'p_teaching_calendar => ' || p_teaching_calendar || ';' ||
164: 'p_org_unt_cd => ' || p_org_unt_cd || ';' ||
393: rec_person_detail cur_person_detail%ROWTYPE;
394: --
395: BEGIN
396: --
397: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
398: fnd_log.string (
399: fnd_log.level_procedure,
400: g_module_head || 'assp_ins_admin_grds.assp_insertgrade.begin',
401: 'In Params : p_person_id => ' || p_person_id || ';' ||
394: --
395: BEGIN
396: --
397: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
398: fnd_log.string (
399: fnd_log.level_procedure,
400: g_module_head || 'assp_ins_admin_grds.assp_insertgrade.begin',
401: 'In Params : p_person_id => ' || p_person_id || ';' ||
402: 'p_course_cd => ' || p_course_cd || ';' ||
395: BEGIN
396: --
397: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
398: fnd_log.string (
399: fnd_log.level_procedure,
400: g_module_head || 'assp_ins_admin_grds.assp_insertgrade.begin',
401: 'In Params : p_person_id => ' || p_person_id || ';' ||
402: 'p_course_cd => ' || p_course_cd || ';' ||
403: 'p_unit_cd => ' || p_unit_cd || ';' ||
482: x_comments => NULL,
483: x_grading_period_cd => 'FINAL'
484: );
485: --
486: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
487: fnd_log.string (
488: fnd_log.level_statement,
489: g_module_head || 'assp_ins_admin_grds.assp_insertgrade.created_outcome',
490: 'Created Outcome for ' || p_person_id || ';' || p_course_cd || ';' || p_uoo_id
483: x_grading_period_cd => 'FINAL'
484: );
485: --
486: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
487: fnd_log.string (
488: fnd_log.level_statement,
489: g_module_head || 'assp_ins_admin_grds.assp_insertgrade.created_outcome',
490: 'Created Outcome for ' || p_person_id || ';' || p_course_cd || ';' || p_uoo_id
491: );
484: );
485: --
486: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
487: fnd_log.string (
488: fnd_log.level_statement,
489: g_module_head || 'assp_ins_admin_grds.assp_insertgrade.created_outcome',
490: 'Created Outcome for ' || p_person_id || ';' || p_course_cd || ';' || p_uoo_id
491: );
492: END IF;
494: EXCEPTION
495: WHEN OTHERS THEN
496: ROLLBACK TO s_before_suao_creation;
497: fnd_file.put_line (fnd_file.log, ' -> ' || SQLERRM);
498: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level) THEN
499: fnd_log.string (
500: fnd_log.level_exception,
501: g_module_head || 'assp_ins_admin_grds.assp_insertgrade.insert_exception',
502: 'SQLERRM => ' || SQLERRM
495: WHEN OTHERS THEN
496: ROLLBACK TO s_before_suao_creation;
497: fnd_file.put_line (fnd_file.log, ' -> ' || SQLERRM);
498: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level) THEN
499: fnd_log.string (
500: fnd_log.level_exception,
501: g_module_head || 'assp_ins_admin_grds.assp_insertgrade.insert_exception',
502: 'SQLERRM => ' || SQLERRM
503: );
496: ROLLBACK TO s_before_suao_creation;
497: fnd_file.put_line (fnd_file.log, ' -> ' || SQLERRM);
498: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level) THEN
499: fnd_log.string (
500: fnd_log.level_exception,
501: g_module_head || 'assp_ins_admin_grds.assp_insertgrade.insert_exception',
502: 'SQLERRM => ' || SQLERRM
503: );
504: END IF;
504: END IF;
505: END;
506: EXCEPTION
507: WHEN OTHERS THEN
508: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level) THEN
509: fnd_log.string (
510: fnd_log.level_exception,
511: g_module_head || 'assp_ins_admin_grds.assp_insertgrade.exception',
512: 'SQLERRM => ' || SQLERRM
505: END;
506: EXCEPTION
507: WHEN OTHERS THEN
508: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level) THEN
509: fnd_log.string (
510: fnd_log.level_exception,
511: g_module_head || 'assp_ins_admin_grds.assp_insertgrade.exception',
512: 'SQLERRM => ' || SQLERRM
513: );
506: EXCEPTION
507: WHEN OTHERS THEN
508: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level) THEN
509: fnd_log.string (
510: fnd_log.level_exception,
511: g_module_head || 'assp_ins_admin_grds.assp_insertgrade.exception',
512: 'SQLERRM => ' || SQLERRM
513: );
514: END IF;
546: AND gsg.grade = cp_grade;
547: --
548: BEGIN
549: --
550: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
551: fnd_log.string (
552: fnd_log.level_procedure,
553: g_module_head || 'assp_ins_admin_grds.assp_findgrade.begin',
554: 'In Params : p_person_id => ' || p_person_id || ';' ||
547: --
548: BEGIN
549: --
550: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
551: fnd_log.string (
552: fnd_log.level_procedure,
553: g_module_head || 'assp_ins_admin_grds.assp_findgrade.begin',
554: 'In Params : p_person_id => ' || p_person_id || ';' ||
555: 'p_course_cd => ' || p_course_cd || ';' ||
548: BEGIN
549: --
550: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
551: fnd_log.string (
552: fnd_log.level_procedure,
553: g_module_head || 'assp_ins_admin_grds.assp_findgrade.begin',
554: 'In Params : p_person_id => ' || p_person_id || ';' ||
555: 'p_course_cd => ' || p_course_cd || ';' ||
556: 'p_unit_cd => ' || p_unit_cd || ';' ||
573: FETCH c_grading_schema_grade INTO v_grade;
574: IF (c_grading_schema_grade%NOTFOUND) THEN
575: CLOSE c_grading_schema_grade;
576: --
577: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
578: fnd_log.string (
579: fnd_log.level_statement,
580: g_module_head || 'assp_ins_admin_grds.assp_findgrade.no_processing',
581: 'Grade to be inserted does not belong to the Grading Schema so skipping the outcome creation'
574: IF (c_grading_schema_grade%NOTFOUND) THEN
575: CLOSE c_grading_schema_grade;
576: --
577: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
578: fnd_log.string (
579: fnd_log.level_statement,
580: g_module_head || 'assp_ins_admin_grds.assp_findgrade.no_processing',
581: 'Grade to be inserted does not belong to the Grading Schema so skipping the outcome creation'
582: );
575: CLOSE c_grading_schema_grade;
576: --
577: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
578: fnd_log.string (
579: fnd_log.level_statement,
580: g_module_head || 'assp_ins_admin_grds.assp_findgrade.no_processing',
581: 'Grade to be inserted does not belong to the Grading Schema so skipping the outcome creation'
582: );
583: END IF;
604: END IF;
605: END IF;
606: EXCEPTION
607: WHEN OTHERS THEN
608: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level) THEN
609: fnd_log.string (
610: fnd_log.level_exception,
611: g_module_head || 'assp_ins_admin_grds.assp_findgrade.exception',
612: 'SQLERRM => ' || SQLERRM
605: END IF;
606: EXCEPTION
607: WHEN OTHERS THEN
608: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level) THEN
609: fnd_log.string (
610: fnd_log.level_exception,
611: g_module_head || 'assp_ins_admin_grds.assp_findgrade.exception',
612: 'SQLERRM => ' || SQLERRM
613: );
606: EXCEPTION
607: WHEN OTHERS THEN
608: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level) THEN
609: fnd_log.string (
610: fnd_log.level_exception,
611: g_module_head || 'assp_ins_admin_grds.assp_findgrade.exception',
612: 'SQLERRM => ' || SQLERRM
613: );
614: END IF;
632: p_no_assessment_type
633: ) LOOP
634: BEGIN
635: --
636: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
637: fnd_log.string (
638: fnd_log.level_statement,
639: g_module_head || 'assp_ins_admin_grds.c_stu_unit_atmpt',
640: v_stu_unit_atmpt_rec.person_id || ';' || v_stu_unit_atmpt_rec.course_cd || ';' ||
633: ) LOOP
634: BEGIN
635: --
636: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
637: fnd_log.string (
638: fnd_log.level_statement,
639: g_module_head || 'assp_ins_admin_grds.c_stu_unit_atmpt',
640: v_stu_unit_atmpt_rec.person_id || ';' || v_stu_unit_atmpt_rec.course_cd || ';' ||
641: v_stu_unit_atmpt_rec.unit_cd || ';' || v_stu_unit_atmpt_rec.version_number || ';' ||
634: BEGIN
635: --
636: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
637: fnd_log.string (
638: fnd_log.level_statement,
639: g_module_head || 'assp_ins_admin_grds.c_stu_unit_atmpt',
640: v_stu_unit_atmpt_rec.person_id || ';' || v_stu_unit_atmpt_rec.course_cd || ';' ||
641: v_stu_unit_atmpt_rec.unit_cd || ';' || v_stu_unit_atmpt_rec.version_number || ';' ||
642: v_stu_unit_atmpt_rec.cal_type || ';' || v_stu_unit_atmpt_rec.ci_sequence_number || ';' ||
660: v_grading_schema,
661: v_gs_version_number
662: )) THEN
663: --
664: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
665: fnd_log.string (
666: fnd_log.level_statement,
667: g_module_head || 'assp_ins_admin_grds.grading_schema_derivation',
668: v_stu_unit_atmpt_rec.person_id || ';' || v_stu_unit_atmpt_rec.course_cd || ';' ||
661: v_gs_version_number
662: )) THEN
663: --
664: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
665: fnd_log.string (
666: fnd_log.level_statement,
667: g_module_head || 'assp_ins_admin_grds.grading_schema_derivation',
668: v_stu_unit_atmpt_rec.person_id || ';' || v_stu_unit_atmpt_rec.course_cd || ';' ||
669: v_stu_unit_atmpt_rec.uoo_id || ';' || v_grading_schema || ';' || v_gs_version_number
662: )) THEN
663: --
664: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
665: fnd_log.string (
666: fnd_log.level_statement,
667: g_module_head || 'assp_ins_admin_grds.grading_schema_derivation',
668: v_stu_unit_atmpt_rec.person_id || ';' || v_stu_unit_atmpt_rec.course_cd || ';' ||
669: v_stu_unit_atmpt_rec.uoo_id || ';' || v_grading_schema || ';' || v_gs_version_number
670: );
681: IF (c_grading_schema_grade%FOUND) THEN
682: v_record_found := TRUE;
683: v_grade := v_grading_schema_grade_rec.grade;
684: --
685: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
686: fnd_log.string (
687: fnd_log.level_statement,
688: g_module_head || 'assp_ins_admin_grds.derived_non_audit_grade',
689: v_stu_unit_atmpt_rec.person_id || ';' || v_stu_unit_atmpt_rec.course_cd || ';' ||
682: v_record_found := TRUE;
683: v_grade := v_grading_schema_grade_rec.grade;
684: --
685: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
686: fnd_log.string (
687: fnd_log.level_statement,
688: g_module_head || 'assp_ins_admin_grds.derived_non_audit_grade',
689: v_stu_unit_atmpt_rec.person_id || ';' || v_stu_unit_atmpt_rec.course_cd || ';' ||
690: v_stu_unit_atmpt_rec.uoo_id || ';' || v_grading_schema || ';' ||
683: v_grade := v_grading_schema_grade_rec.grade;
684: --
685: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
686: fnd_log.string (
687: fnd_log.level_statement,
688: g_module_head || 'assp_ins_admin_grds.derived_non_audit_grade',
689: v_stu_unit_atmpt_rec.person_id || ';' || v_stu_unit_atmpt_rec.course_cd || ';' ||
690: v_stu_unit_atmpt_rec.uoo_id || ';' || v_grading_schema || ';' ||
691: v_gs_version_number || ';' || v_grade
742: IF (c_grading_schema_audit_grade%FOUND) THEN
743: v_record_found := TRUE;
744: v_audit_grade := v_grading_schema_grade_rec.grade;
745: --
746: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
747: fnd_log.string (
748: fnd_log.level_statement,
749: g_module_head || 'assp_ins_admin_grds.derived_audit_grade',
750: v_stu_unit_atmpt_rec.person_id || ';' || v_stu_unit_atmpt_rec.course_cd || ';' ||
743: v_record_found := TRUE;
744: v_audit_grade := v_grading_schema_grade_rec.grade;
745: --
746: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
747: fnd_log.string (
748: fnd_log.level_statement,
749: g_module_head || 'assp_ins_admin_grds.derived_audit_grade',
750: v_stu_unit_atmpt_rec.person_id || ';' || v_stu_unit_atmpt_rec.course_cd || ';' ||
751: v_stu_unit_atmpt_rec.uoo_id || ';' || v_grading_schema || ';' ||
744: v_audit_grade := v_grading_schema_grade_rec.grade;
745: --
746: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
747: fnd_log.string (
748: fnd_log.level_statement,
749: g_module_head || 'assp_ins_admin_grds.derived_audit_grade',
750: v_stu_unit_atmpt_rec.person_id || ';' || v_stu_unit_atmpt_rec.course_cd || ';' ||
751: v_stu_unit_atmpt_rec.uoo_id || ';' || v_grading_schema || ';' ||
752: v_gs_version_number || ';' || v_audit_grade
841: WHEN OTHERS THEN
842: --
843: -- Log the error and skip to the next record
844: --
845: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level) THEN
846: fnd_log.string (
847: fnd_log.level_exception,
848: g_module_head || 'assp_ins_admin_grds.assp_findgrade.exception',
849: 'Skipping to next record due to error => ' || SQLERRM
842: --
843: -- Log the error and skip to the next record
844: --
845: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level) THEN
846: fnd_log.string (
847: fnd_log.level_exception,
848: g_module_head || 'assp_ins_admin_grds.assp_findgrade.exception',
849: 'Skipping to next record due to error => ' || SQLERRM
850: );
843: -- Log the error and skip to the next record
844: --
845: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level) THEN
846: fnd_log.string (
847: fnd_log.level_exception,
848: g_module_head || 'assp_ins_admin_grds.assp_findgrade.exception',
849: 'Skipping to next record due to error => ' || SQLERRM
850: );
851: END IF;
857: EXCEPTION
858: WHEN OTHERS THEN
859: ROLLBACK TO s_before_insert;
860: retcode := 2;
861: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level) THEN
862: fnd_log.string (
863: fnd_log.level_exception,
864: g_module_head || 'assp_ins_admin_grds.exception',
865: 'SQLERRM => ' || SQLERRM
858: WHEN OTHERS THEN
859: ROLLBACK TO s_before_insert;
860: retcode := 2;
861: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level) THEN
862: fnd_log.string (
863: fnd_log.level_exception,
864: g_module_head || 'assp_ins_admin_grds.exception',
865: 'SQLERRM => ' || SQLERRM
866: );
859: ROLLBACK TO s_before_insert;
860: retcode := 2;
861: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level) THEN
862: fnd_log.string (
863: fnd_log.level_exception,
864: g_module_head || 'assp_ins_admin_grds.exception',
865: 'SQLERRM => ' || SQLERRM
866: );
867: END IF;