← Back to Cases
IBY Duplicate External Bank Accounts — Remap All References to Valid Account and Delete Duplicates
Case Number00044997
Oracle ModuleOracle Payments (IBY) / Accounts Payable (AP) / Accounts Receivable (AR) / Oracle Lease Management (OKL)
EBS VersionR12
Functional AreaBank Account Setup / External Bank Accounts / Payment Instrument Assignments
Related PatchesOracle Patch 10144798

Symptoms

Root Cause

Duplicate external bank account records were created in IBY_EXT_BANK_ACCOUNTS — typically through concurrent data entry, upgrades, or data migrations that did not enforce uniqueness on the bank account number + bank + branch + currency combination. All downstream references (payment instrument assignments, payments, documents payable, AP invoices, AP checks, AR interface lines, OKL contract and lease tables) still point to the duplicate account IDs. The fix uses a driver table (IBY_EFFECTED_ACCTS_10144798) that maps each duplicate ext_bank_account_id to its valid canonical counterpart, then remaps all downstream references and deletes the duplicates. Country-specific uniqueness logic is applied for Japan (includes bank_account_type) and New Zealand (includes ACCOUNT_SUFFIX).

Resolution

Pre-requisite – Populate the driver table

Create and populate IBY_EFFECTED_ACCTS_10144798 with all duplicate external bank account IDs, ranked so that rank=1 identifies the valid/canonical account for each duplicate group. Run the Oracle selection script (iby_dup_bnkAcct_Sel.sql) to identify the duplicate accounts and populate this table before running the fix.

Step 1 – Create driving and backup tables

Run data_fix.sql. The script uses IBY_DATA_FIX_UTILITY_PKG for HTML log output. It creates the following tables:

Step 2 – Populate driving tables

Insert into IBY_DUP_ACCTS_10144798 by joining the driver table to itself to identify duplicate-to-valid account ID mappings for all countries (standard), Japan (bank_account_type included in key), and New Zealand (ACCOUNT_SUFFIX included in key). Populate IBY_DUP_INSTR_ASGN_10144798 to map duplicate instrument payment uses to their valid equivalents.

Step 3 – Back up affected rows

Insert affected rows into backup tables from: IBY_EXT_BANK_ACCOUNTS, IBY_ACCOUNT_OWNERS, IBY_PMT_INSTR_USES_ALL, IBY_PAYMENTS_ALL, IBY_DOCS_PAYABLE_ALL, IBY_UPG_INSTRUMENTS, AP_PAYMENT_SCHEDULES_ALL, AP_CHECKS_ALL, AP_INVOICE_PAYMENTS_ALL, AP_INVOICES_ALL, IBY_FNDCPT_TX_EXTENSIONS, IBY_TRXN_SUMMARIES_ALL, OKL_TAA_REQUEST_DETAILS_B, OKC_RULES_B, RA_INTERFACE_LINES_ALL, and conditionally OKL contract/extract tables if the columns exist.

Step 4 – Remap all references to the valid account ID

Update all downstream tables to replace duplicate ext_bank_account_id references with the valid canonical ID:

Step 5 – Delete duplicate bank account records

Delete from IBY_EXT_BANK_ACCOUNTS for all ext_bank_account_id values identified as duplicates in the driver table. Commit.

Note: This script is based on Oracle's own data fix script for Patch 10144798 (IBY duplicate external bank accounts), modified by RSI to handle cases where duplicate instr_assign_id values exist in the assignments driving table. The driver table IBY_EFFECTED_ACCTS_10144798 must be created and populated before running this script — see Oracle's selection script iby_dup_bnkAcct_Sel.sql. The script generates an HTML output log via IBY_DATA_FIX_UTILITY_PKG. Do not delete the driving tables IBY_DUP_ACCTS_10144798 and IBY_DUP_INSTR_ASGN_10144798 after the fix — they provide the mapping of duplicate to valid IDs for future reference.

Script Inventory

FileDescription
data_fix.sqlPL/SQL script based on Oracle Patch 10144798 IBY duplicate bank account fix, modified by RSI. Uses IBY_DATA_FIX_UTILITY_PKG for HTML logging. Requires pre-populated IBY_EFFECTED_ACCTS_10144798 driver table. Creates driving tables (IBY_DUP_ACCTS_10144798, IBY_DUP_INSTR_ASGN_10144798) and backup tables for all affected tables. Remaps all downstream references from duplicate to valid ext_bank_account_id across IBY, AP, AR, and OKL tables. Deletes duplicate IBY_EXT_BANK_ACCOUNTS records.

Key Tables Affected

TableAction
IBY_EXT_BANK_ACCOUNTSDelete duplicate bank account records
IBY_ACCOUNT_OWNERSDelete duplicate ownership rows; update ext_bank_account_id to valid ID
IBY_PMT_INSTR_USES_ALLDelete duplicate instrument use assignments; update instrument_id to valid account ID
IBY_PAYMENTS_ALLUpdate external_bank_account_id to valid account ID
IBY_DOCS_PAYABLE_ALLUpdate external_bank_account_id to valid account ID
IBY_UPG_INSTRUMENTSUpdate instrument_id and instr_assignment_id to valid values
IBY_FNDCPT_TX_EXTENSIONSUpdate INSTR_ASSIGNMENT_ID to valid assignment ID
IBY_TRXN_SUMMARIES_ALLUpdate PAYER_INSTR_ASSIGNMENT_ID and PAYERINSTRID
AP_INVOICES_ALLUpdate external_bank_account_id to valid account ID
AP_PAYMENT_SCHEDULES_ALLUpdate external_bank_account_id to valid account ID
AP_CHECKS_ALLUpdate external_bank_account_id to valid account ID
AP_INVOICE_PAYMENTS_ALLUpdate external_bank_account_id to valid account ID
RA_INTERFACE_LINES_ALLUpdate customer_bank_account_id to valid account ID
OKL / OKC tablesUpdate bank account and assignment ID references to valid values (conditional)