Tuesday, 15 July 2025

Oracle Fusion Sub Ledger Accounting Tables with Sample SQL Queries

Oracle Fusion SLA Tables with SQL Examples

๐Ÿ” Introduction

Oracle Subledger Accounting (SLA) is the rules-based engine that generates accounting entries for transactions from subledgers such as Payables, Receivables, and Assets. It provides a unified accounting model that feeds into the General Ledger (GL).

This post explores key SLA tables, explains how they interrelate, and provides practical SQL queries for reconciliation, reporting, and debugging.

๐Ÿ“‚ Key SLA Tables Overview

Table Name Description
XLA_EVENTS Stores business events triggered in subledgers
XLA_AE_HEADERS Header-level journal entry info
XLA_AE_LINES Line-level accounting entries
XLA_DISTRIBUTION_LINKS Maps SLA lines to source distributions like invoice lines
XLA_TRANSACTION_ENTITIES Information about subledger transactions
XLA_SUBLEDGER_SOURCES Defines source systems like Payables, AR, Assets
XLA_LEDGER_OPTIONS Stores ledger-specific SLA options and setups

๐Ÿ”— How SLA Tables Are Related

  • Transaction Entity: Stored in XLA_TRANSACTION_ENTITIES
  • Event: Created in XLA_EVENTS
  • Header & Line Entries: XLA_AE_HEADERS and XLA_AE_LINES
  • Distribution Mapping: via XLA_DISTRIBUTION_LINKS

๐Ÿงช Sample SQL Queries

1. ๐Ÿ“˜ SLA Journal Entries for a Payables Invoice


SELECT xah.ae_header_id,
       xal.ae_line_num,
       xal.accounted_cr,
       xal.accounted_dr,
       xal.code_combination_id,
       gcc.segment1 AS company,
       gcc.segment2 AS account,
       xah.accounting_date,
       xah.description
FROM xla_ae_headers xah
JOIN xla_ae_lines xal
  ON xah.ae_header_id = xal.ae_header_id
JOIN gl_code_combinations gcc
  ON xal.code_combination_id = gcc.code_combination_id
WHERE xah.entity_id IN (
    SELECT xte.entity_id
    FROM xla_transaction_entities xte
    WHERE xte.source_id_int_1 = :invoice_id
      AND xte.application_id = 200
)
AND xal.accounting_class_code IS NOT NULL;


2. ๐Ÿ”„ Distribution Line Mapping


SELECT xdl.source_distribution_type,
       xdl.source_distribution_id_num_1,
       xal.accounted_dr,
       xal.accounted_cr,
       xal.code_combination_id
FROM xla_distribution_links xdl
JOIN xla_ae_lines xal
  ON xdl.ae_line_id = xal.ae_line_id
WHERE xdl.source_distribution_type = 'AP_INVOICE_DISTRIBUTIONS'
AND xdl.source_distribution_id_num_1 = :invoice_distribution_id;

๐Ÿ› ️ Use Cases for These Queries

  • Trace invoice entries to General Ledger
  • Reconcile SLA data with GL balances
  • Debug incorrect journal entries or posting failures
  • Build reports using BI Publisher or OTBI

๐Ÿ“š Conclusion

Oracle Fusion Subledger Accounting forms the foundation for robust financial tracking across subledgers. By understanding the XLA table structure and using SQL efficiently, technical users can generate powerful audit trails, improve reconciliation, and build end-to-end financial insights.


Oracle Fusion Payments Tables with Sample Queries

Oracle Fusion Payments Tables with Sample Queries

Oracle Fusion Payments is the centralized payment engine behind Oracle Financials. It processes disbursements and receipts across modules like Payables, Receivables, and Expenses. This post will help provide the underlying tables can help technical and functional consultants can use for the reports and troubleshoot paymenting issues, and support customizations.

๐Ÿ” Key Oracle Fusion Payments Tables

Here are the most commonly used tables in Oracle Fusion Payments:

Table Name Description
IBY_PAY_SERVICE_REQUESTS Stores payment service request details for each disbursement
IBY_DOCS_PAYABLE_ALL Contains invoice or refund records selected for payment
IBY_PAY_INSTRUCTIONS_ALL Payment instructions sent for formatting and transmission
IBY_PAYMENTS_ALL Details of actual payments created by the system
IBY_PAYMENT_DETAILS Payment breakdowns linked to instructions
IBY_PMT_INSTR_USES_ALL Payment instruments like bank accounts or credit cards
IBY_EXTERNAL_PAYEES_ALL Supplier or employee payee information
CE_PAYMENT_TRANSACTIONS Cash Management view of payment transactions
AP_INVOICES_ALL Source invoices from Oracle Payables

๐Ÿงฉ How These Tables Are Related

The relationships between these tables are essential for linking invoice to payment:

  • Invoices from AP_INVOICES_ALL become documents payable in IBY_DOCS_PAYABLE_ALL.
  • Each document is tied to a payment service request in IBY_PAY_SERVICE_REQUESTS.
  • Requests are grouped into payment instructions via IBY_PAY_INSTRUCTIONS_ALL.
  • Payments are recorded in IBY_PAYMENTS_ALL and detailed in IBY_PAYMENT_DETAILS.

๐Ÿงช Sample SQL Queries

1. Invoices Selected for Payment


SELECT dp.payment_service_request_id,
       dp.invoice_id,
       ai.invoice_num,
       ai.invoice_amount,
       dp.payment_status
FROM iby_docs_payable_all dp
JOIN ap_invoices_all ai
  ON dp.invoice_id = ai.invoice_id
WHERE dp.payment_status = 'SELECTED';

2. Payment Instruction Details


SELECT pi.payment_instruction_id,
       pi.status,
       pi.payment_profile_id,
       pi.creation_date,
       COUNT(pd.payment_id) AS total_payments
FROM iby_pay_instructions_all pi
LEFT JOIN iby_payment_details pd
  ON pi.payment_instruction_id = pd.payment_instruction_id
GROUP BY pi.payment_instruction_id, pi.status, pi.payment_profile_id, pi.creation_date;

3. Payment Summary by Supplier


SELECT epa.supplier_name,
       SUM(p.amount) AS total_paid,
       COUNT(p.payment_id) AS payments_made
FROM iby_payments_all p
JOIN iby_external_payees_all epa
  ON p.payee_party_id = epa.payee_party_id
GROUP BY epa.supplier_name
ORDER BY total_paid DESC;

4. Trace Invoice to Payment


SELECT ai.invoice_num,
       ai.invoice_amount,
       dp.payment_service_request_id,
       psr.calling_app_doc_ref_number,
       pi.payment_instruction_id,
       p.payment_id,
       p.amount,
       p.status
FROM ap_invoices_all ai
JOIN iby_docs_payable_all dp
  ON ai.invoice_id = dp.invoice_id
JOIN iby_pay_service_requests psr
  ON dp.payment_service_request_id = psr.payment_service_request_id
JOIN iby_pay_instructions_all pi
  ON psr.payment_instruction_id = pi.payment_instruction_id
JOIN iby_payments_all p
  ON pi.payment_instruction_id = p.payment_instruction_id
WHERE ai.invoice_num = 'INV12345';

๐Ÿ“Œ Tips for Working with Payments Tables

  • Check IBY_PAYMENTS_ALL.status for values like ISSUED, VOIDED, or CANCELLED
  • Use CE_PAYMENT_TRANSACTIONS to track reconciled bank transactions
  • Always apply ORG_ID or LEDGER_ID in multi-org setups

๐Ÿ“š Conclusion

Understanding the Oracle Fusion Payments data model enables you to extract insights, troubleshoot effectively, and support automation. These queries are just a starting point. You can extend them for BI Publisher, OTBI, or external reporting integrations.

Monday, 14 July 2025

Oracle 23ai Database - Features and capabilities

 Here’s a technical blogpost on the key technical features of Oracle Database 23ai.

  Feature                               What It Enables                                

1. AI Vector Search               Semantic search, LLM integration, RAG apps     

2. JSON Relational Duality  API-ready relational data                      

3.SQL Firewall                    Threat protection at query level               

4. AI Optimizer                     Smart execution plans, less DBA tuning         

5. Multicloud Native            Deploy Oracle in AWS & Azure natively          

6. Property Graphs               Advanced analytics and recommendations         

7. Dev Experience               Better language support, REST APIs, JavaScript 


Oracle Database 23ai: AI‑Powered Database

 This blog post provides some details of the Oracle Database 23ai.


Oracle’s latest long-term-support release, 23ai (“ai” for Artificial Intelligence), launched last year 2024, introduces powerful native AI capabilities—most notably AI Vector Search—combined with over 300 new features across data, development, and infrastructure

This post help provide basic understanding Oracle Database 23ai and its features.

AI Vector Search

A flagship capability: search unstructured data semantically by converting text/images into vectors using the new VECTOR datatype

Key features:

  • VECTOR column support in tables

  • Create vector indexes

  • Perform semantic search via SQL functions

  • Optional accuracy tuning in queries

  • Exadata optimizations for fast vector processing

Oracle Database 23ai transforms your Oracle environment into an AI-first, semantic engine:

  • Install via Free edition or containers in minutes.

  • Define VECTOR columns, populate embeddings, and build vector indexes.

  • Query unstructured & structured data semantically.

  • Integrate with RAG flows using SQL/PLSQL/Python.

  • Scale easily using Python/JDBC clients and Exadata.

AI-Assisted Optimizer & Adaptive Query Execution

Oracle 23ai enhances the Cost-Based Optimizer (CBO) with AI/ML features that help:

  • Predict better execution plans

  • Learn from historical workloads

  • Adapt plans at runtime using AI-enhanced estimation

  • Self-adjusting SQL plans without human tuning

  • Supports real-time statistics, feedback-based optimization




Monday, 7 July 2025

Oracle Fusion Cash Management: Key Tables and Sample SQL Queries

 

Oracle Fusion Cash Management: Key Tables and Sample SQL Queries

Oracle Fusion Cash Management (CE) plays a critical role in managing and reconciling an organization’s bank accounts, cash positions, and liquidity. 

This post will help in understanding the core Cash Management tables and relationships is essential for building reports and integrations.

In this blog post, we will discuss about :

  • Core Cash Management Tables

  • Table Relationships

  • Sample SQL Queries

  • Common Use Cases


Key Oracle Fusion Cash Management Tables

Table NameDescription
CE_BANK_ACCOUNTSStores bank account definitions (shared with Payables).
CE_BANK_ACCT_USES_ALLLinks bank accounts to uses (Payables, Receivables, Payroll, etc.).
CE_STATEMENT_HEADERSStores bank statement header details.
CE_STATEMENT_LINESContains transaction lines from bank statements (debits/credits).

Table Relationships

CE_BANK_ACCOUNTS → CE_BANK_ACCT_USES_ALL → CE_STATEMENT_HEADERS → CE_STATEMENT_LINES

Sample SQL Queries


1. List of Bank Accounts

SELECT
cba.bank_account_id, cba.bank_account_name, cba.bank_account_num, cba.currency_code, cba.bank_id, cba.branch_id FROM ce_bank_accounts cba WHERE cba.enabled_flag = 'Y';

2. Bank Account Uses (e.g., Payables/Receivables)

SELECT
cba.bank_account_name, cau.uses_type, cau.start_date, cau.end_date FROM ce_bank_acct_uses_all cau, ce_bank_accounts cba
WHERE cau.bank_account_id = cba.bank_account_id AND cau.uses_type IN ('PAYABLES', 'RECEIVABLES');

3. Bank Statement with Line Items


SELECT csh.statement_header_id, csh.statement_num, csh.bank_account_id, csl.line_number, csl.trx_date, csl.amount, csl.trx_code, csl.description FROM ce_statement_headers csh, ce_statement_lines csl
WHERE csh.statement_header_id = csl.statement_header_id AND csh.creation_date >= TO_DATE('2024-01-01','YYYY-MM-DD');

4. Cash Balance by Bank Account

SELECT
cb.bank_account_id, cb.balance_date, cb.balance_amount, cb.currency_code FROM ce_balances cb WHERE cb.balance_date = TO_DATE('2024-06-30', 'YYYY-MM-DD');

Real-World Use Cases

  • Cash Position Reporting: Determine current balances across accounts.

  • ๐Ÿ” Bank Reconciliation: Track unreconciled transactions or mismatches.

  • ๐Ÿฆ Bank Statement Review: Analyze incoming/outgoing transactions from the bank feed.


Tips

  • Check CE_BALANCES for real-time vs as-of-date balances.

  • Use CE_STATEMENT_LINES for tracking bank fees, interest, or ACH deposits.

  • For multi-currency environments, ensure you're filtering by currency_code.



Oracle Fusion Fixed Assets Tables – Key Tables and Sample Queries

Oracle Fusion Fixed Assets (FA) is a comprehensive module used for managing an organization's fixed assets lifecycle—from acquisition to retirement. 

For technical developers and report builders, understanding the underlying Fusion FA tables is crucial to extract and analyze data accurately.

In this blog, we will dive into:

  • Key Oracle Fusion Fixed Assets Tables

  • Table Relationships

  • Sample SQL Queries

  • Real-world Use Cases


Key Oracle Fusion Fixed Assets Tables

Table NameDescription
FA_ASSET_HISTORYStores asset-level information like asset number, description, and tag.
FA_BOOKSMaintains asset financial details per asset book (e.g., depreciation method, cost, YTD depreciation).
FA_CATEGORIES_BContains asset category definitions.
FA_ADDITIONS_BUsed during the asset addition process.
FA_DISTRIBUTION_HISTORYTracks accounting and distribution information by cost center/project.
FA_RETIREMENTSRecords asset retirement data.
FA_DEPRN_SUMMARYStores summarized depreciation data for each asset per period.
FA_LOCATIONSHolds the location details where assets are deployed.

Table Relationships with Other tables

  • FA_ASSET_HISTORY ➝ Asset core info
    joins to FA_BOOKS on ASSET_ID
    joins to FA_CATEGORIES_B on CATEGORY_ID
    joins to FA_LOCATIONS on LOCATION_ID
    joins to FA_DISTRIBUTION_HISTORY for cost center info
    joins to FA_DEPRN_SUMMARY for depreciation data


Sample SQL Queries

Below are some of the Sample Queries.

1. Basic Asset Details

SELECT
fah.asset_number, fah.description, fb.book_type_code, fb.date_placed_in_service, fb.cost, fb.ytd_deprn, fcb.category_description, fl.location_description FROM fa_asset_history fah,
fa_books fb,
fa_categories_b fcb,
fa_locations fl WHERE fah.asset_id = fb.asset_id AND fb.category_id = fcb.category_id AND fah.location_id = fl.location_id AND fb.book_type_code = 'CORPORATE' AND fb.date_placed_in_service BETWEEN TO_DATE('2024-01-01','YYYY-MM-DD') AND TO_DATE('2024-12-31','YYYY-MM-DD');

2. Asset Retirement Report

SELECT
fah.asset_number, fb.book_type_code, fr.retirement_date, fr.retirement_type_code, fr.proceeds_of_sale, fr.gain_loss FROM fa_asset_history fah,
fa_books fb,
fa_retirements fr WHERE fah.asset_id = fb.asset_id AND fb.asset_id = fr.asset_id AND fr.retirement_date >= TO_DATE('2024-01-01','YYYY-MM-DD');

3. Depreciation Summary for a Period

SELECT
fah.asset_number, fb.book_type_code, fds.period_name, fds.deprn_amount, fds.ytd_deprn FROM fa_asset_history fah,
fa_books fb,
fa_deprn_summary fds WHERE fah.asset_id = fb.asset_id AND fb.asset_id = fds.asset_id AND fds.period_name = 'JUN-24' AND fb.book_type_code = 'CORPORATE';

4. Assets by Cost Center or Project


SELECT fah.asset_number, fb.cost, fdh.code_combination_id, gl.segment1 AS cost_center FROM fa_asset_history fah,
fa_books fb,
fa_distribution_history fdh,
gl_code_combinations gl WHERE fah.asset_id = fb.asset_id AND fb.asset_id = fdh.asset_id AND fdh.code_combination_id = gl.code_combination_id AND gl.segment1 = '1001'; -- Replace with your cost center

Use Cases for These Queries

  • Internal Audits: Asset existence, placement, depreciation status

  • Finance Reporting: Capital expenditure, asset additions/retirements

  • Cost Allocation: Cost center or project-based distribution

  • Fixed Asset Reconciliation: Verify system balances with physical checks


Notes : 

  • Always validate the Book Type Code (CORPORATE, TAX, etc.).

  • Use Asset Status to filter retired, transferred, or fully depreciated assets.