[Home] [Help]
591: || Altered parameters of chk_dup_cur and c_null_hdlg_res_cur to reflect the
592: || changes in unique index
593: || pkpatel 9-Nov-2004 Bug 3993967 (Removed Start/End Date. Included Term)
594: ||--------------------------------------------------------------------------------*/
595: l_status igs_pe_res_dtls_int.status%TYPE;
596: p_error_code igs_pe_res_dtls_int.ERROR_CODE%TYPE;
597: l_match_ind igs_pe_res_dtls_int.match_ind%TYPE;
598: l_processed_records NUMBER(5) := 0;
599: l_prog_label VARCHAR2(4000);
592: || changes in unique index
593: || pkpatel 9-Nov-2004 Bug 3993967 (Removed Start/End Date. Included Term)
594: ||--------------------------------------------------------------------------------*/
595: l_status igs_pe_res_dtls_int.status%TYPE;
596: p_error_code igs_pe_res_dtls_int.ERROR_CODE%TYPE;
597: l_match_ind igs_pe_res_dtls_int.match_ind%TYPE;
598: l_processed_records NUMBER(5) := 0;
599: l_prog_label VARCHAR2(4000);
600: l_label VARCHAR2(4000);
593: || pkpatel 9-Nov-2004 Bug 3993967 (Removed Start/End Date. Included Term)
594: ||--------------------------------------------------------------------------------*/
595: l_status igs_pe_res_dtls_int.status%TYPE;
596: p_error_code igs_pe_res_dtls_int.ERROR_CODE%TYPE;
597: l_match_ind igs_pe_res_dtls_int.match_ind%TYPE;
598: l_processed_records NUMBER(5) := 0;
599: l_prog_label VARCHAR2(4000);
600: l_label VARCHAR2(4000);
601: l_debug_str VARCHAR2(4000);
605: l_interface_run_id igs_ad_interface_all.interface_run_id%TYPE;
606:
607: CURSOR res_cur(cp_interface_run_id igs_ad_interface_all.interface_run_id%TYPE) IS
608: SELECT mi.*, i.person_id
609: FROM igs_pe_res_dtls_int mi,igs_ad_interface_all i
610: WHERE mi.interface_run_id = cp_interface_run_id
611: AND mi.interface_id = i.interface_id
612: AND i.interface_run_id = cp_interface_run_id
613: AND mi.status = '2';
735:
736: EXCEPTION
737: WHEN NO_DATA_FOUND THEN
738: -- Validation Unsuccessful
739: UPDATE igs_pe_res_dtls_int
740: SET status = '3',
741: error_code = p_error_code
742: WHERE interface_res_id = res_dtls_rec.interface_res_id;
743: IF l_enable_log = 'Y' THEN
932: l_rule := igs_ad_imp_001.find_source_cat_rule(p_source_type_id,'PERSON_RESIDENCY_DETAILS');
933:
934: -- If rule is E or I, then if the match_ind is not null, the combination is invalid
935: IF l_rule IN ('E','I') THEN
936: UPDATE igs_pe_res_dtls_int
937: SET status = cst_stat_val_3,
938: ERROR_CODE = cst_err_val_695 -- Error code depicting incorrect combination
939: WHERE match_ind IS NOT NULL
940: AND status = cst_stat_val_2
942: END IF;
943:
944: -- If rule is E and duplicate exists, update match_ind to 19 and status to 1
945: IF l_rule = 'E' THEN
946: UPDATE igs_pe_res_dtls_int mi
947: SET status = cst_stat_val_1,
948: match_ind = cst_mi_val_19
949: WHERE mi.interface_run_id = l_interface_run_id
950: AND mi.status = cst_stat_val_2
960:
961: -- If rule is R and there match_ind is 18,19,22 or 23 then the records must have been
962: -- processed in prior runs and didn't get updated .. update to status 1
963: IF l_rule = 'R' THEN
964: UPDATE igs_pe_res_dtls_int
965: SET status = cst_stat_val_1
966: WHERE interface_run_id = l_interface_run_id
967: AND match_ind IN (cst_mi_val_18,cst_mi_val_19,cst_mi_val_22,cst_mi_val_23)
968: AND status = cst_stat_val_2;
969: END IF;
970:
971: -- If rule is R and match_ind is neither 21 nor 25 then error
972: IF l_rule = 'R' THEN
973: UPDATE igs_pe_res_dtls_int
974: SET status = cst_stat_val_3,
975: ERROR_CODE = cst_err_val_695
976: WHERE interface_run_id = l_interface_run_id
977: AND status = cst_stat_val_2
979: END IF;
980:
981: -- If rule is R, set duplicated records with no discrepancy to status 1 and match_ind 23
982: IF l_rule = 'R' THEN
983: UPDATE igs_pe_res_dtls_int mi
984: SET status = cst_stat_val_1,
985: match_ind = cst_mi_val_23
986: WHERE mi.interface_run_id = l_interface_run_id
987: AND mi.match_ind IS NULL
1020: END IF;
1021:
1022: -- If rule is R records still exist, they are duplicates and have discrepancy .. update status=3,match_ind=20
1023: IF l_rule = 'R' THEN
1024: UPDATE igs_pe_res_dtls_int mi
1025: SET status = cst_stat_val_3,
1026: match_ind = cst_mi_val_20
1027: WHERE mi.interface_run_id = l_interface_run_id
1028: AND mi.match_ind IS NULL
1101: END IF;
1102: --
1103: -- Update the interface record with the status, error_code, match_ind, only when NOT coming from UCAS.
1104: --
1105: UPDATE igs_pe_res_dtls_int
1106: SET status = l_status,
1107: error_code = p_error_code,
1108: match_ind = l_match_ind
1109: WHERE interface_res_id = res_dtl_rec.interface_res_id;
1109: WHERE interface_res_id = res_dtl_rec.interface_res_id;
1110:
1111: EXCEPTION
1112: WHEN OTHERS THEN
1113: UPDATE igs_pe_res_dtls_int
1114: SET
1115: status = '3',
1116: error_code = 'E518'
1117: WHERE interface_res_id = res_dtl_rec.interface_res_id;