Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Solution for bug 340730 Duplicate MER was entered.
See subtask 341656 Remove Duplicate MER for the exact scripts that were run.

  1. Identify and backup the applicant records.

    Code Block
    languagesql
    select * from UA006_MEDICAL_EXAMINATION
    where FAMILY_NAME_NM = 'familyname'
    and upper(FIRST_NAME_NM) like upper('firstname%');
  2. Select specific columns.

    Code Block
    languagesql
    select MEDICAL_EXAMINATION_ID, MEDICAL_EXAMINATION_DTE, LICENCE_NUM, APPLICANT_PERSON_ID, FIRST_NAME_NM, FAMILY_NAME_NM, DATE_BIRTH_DTE, STAMP_NUMBER_TXT, DATE_CREATED_DTE, DATE_DELETED_DTE, DATE_LAST_UPDATE_DTE, DATE_EMER_SUBMITTED_DTE
    from UA006_MEDICAL_EXAMINATION
    where FAMILY_NAME_NM = 'familyname'
    and upper(FIRST_NAME_NM) like upper('firstnsme%');
  3. Remove the duplicate record by setting the DATE_DELETED_DTE to current date:

    Code Block
    update UA006_MEDICAL_EXAMINATION
    set DATE_DELETED_DTE = SYSDATE
    where MEDICAL_EXAMINATION_ID = medical_examination_id and LICENCE_NUM = licence_num;
  4. Commit the change to the database:

    Code Block
    COMMIT;
  5. Viewed the change:

    Code Block
    languagesql
    --Viewed that change after the update statement was run
    select MEDICAL_EXAMINATION_ID, MEDICAL_EXAMINATION_DTE, LICENCE_NUM, FIRST_NAME_NM, FAMILY_NAME_NM, STAMP_NUMBER_TXT, DATE_CREATED_DTE, DATE_DELETED_DTE, DATE_LAST_UPDATE_DTE
    from UA006_MEDICAL_EXAMINATION
    where MEDICAL_EXAMINATION_ID = medical_examination_id and LICENCE_NUM = licence_num;
  6. Check for related records in UA016_ACTIVITY_CLUSTER:
    (there were none for the bug I worked on. If there are, they should also be “removed”).

    Code Block
    languagesql
    --check for related records in UA016_ACTIVITY_CLUSTER
    select * from UA016_ACTIVITY_CLUSTER
    where APPLICANT_PERSON_ID = applicant_person_id
    and MEDICAL_EXAMINATION_ID = medical_examination_id;
  7. Check for related records in UA033_APPLICANT_DOCUMENT:
    (there were none for the bug I worked on. If there are, they should also be “removed”).

    Code Block
    languagesql
    --check for related records in UA033_APPLICANT_DOCUMENT
    select * from UA033_APPLICANT_DOCUMENT
    where APPLICANT_PERSON_ID = applicant_person_id;