Customer account bank information

Customer account bank information

In this blog post, we'll provide a simple SQL query to quickly retrieve a customer's bank account details from Oracle EBS Receivables. This straightforward query will help streamline your development process by allowing you to easily fetch essential information like bank name, account number, and branch code.

select part.orig_system_reference,
       cac.account_number,
       part.party_name,
       epa.party_id,
       eba.bank_account_num,
       eba.masked_bank_account_num,
       eba.iban,
       eba.masked_iban,
       eba.bank_id,
       eba.branch_id,
       eba.attribute9,
       eba.ext_bank_account_id,
       eba.start_date eba_start_date,
       eba.end_date eba_end_date,
       piu.start_date piu_start_date,
       piu.end_date piu_end_date,
       piu.order_of_preference,
       piu.instrument_payment_use_id,
       (select prt_owner.party_name
          from iby_account_owners aos_owner, 
               iby_external_payers_all epa_owner, 
               hz_parties prt_owner
         where aos_owner.ext_bank_account_id = eba.ext_bank_account_id
           and aos_owner.primary_flag = 'Y'
           and aos_owner.account_owner_party_id = epa_owner.party_id
           and epa_owner.acct_site_use_id is null
           and epa_owner.party_id = prt_owner.party_id) owner,
       cac.attribute1
  from iby_pmt_instr_uses_all  piu,
       iby_external_payers_all epa,
       iby_ext_bank_accounts   eba,
       hz_cust_accounts        cac,
       hz_parties              part
 where piu.payment_flow = 'FUNDS_CAPTURE'
   and piu.ext_pmt_party_id = epa.ext_payer_id
   and epa.acct_site_use_id is null
   and piu.instrument_id = eba.ext_bank_account_id
   and epa.party_id = part.party_id
   and cac.party_id = part.party_id
   and cac.status = 'A'
   and part.status = 'A'
   and exists (select 1
          from hz_party_usg_assignments
         where party_id = part.party_id
           and party_usage_code = 'CUSTOMER'
           and status_flag = 'A'
           and sysdate between effective_start_date and effective_end_date);