Oracle Fusion SCM BI Publisher SQL Query Generator
Most custom Oracle Fusion reports start as a BI Publisher data model with a SQL query against base tables. This generator produces starter queries for the three most requested datasets so you can paste, adapt and test.
Fill in
Numeric ORGANIZATION_ID from your instance
Used with LIKE
Item master (items in an organization)
SELECT esib.INVENTORY_ITEM_ID,
esib.ORGANIZATION_ID,
esib.ITEM_NUMBER,
esib.PRIMARY_UOM_CODE,
esib.INVENTORY_ITEM_STATUS_CODE,
esib.CREATION_DATE
FROM EGP_SYSTEM_ITEMS_B esib
WHERE esib.ORGANIZATION_ID = 300000012345678
AND esib.ITEM_NUMBER LIKE 'FG-%'
ORDER BY esib.ITEM_NUMBEROn-hand quantity by subinventory
SELECT oh.INVENTORY_ITEM_ID,
oh.ORGANIZATION_ID,
oh.SUBINVENTORY_CODE,
SUM(oh.PRIMARY_TRANSACTION_QUANTITY) AS ONHAND_QTY
FROM INV_ONHAND_QUANTITIES_DETAIL oh
WHERE oh.ORGANIZATION_ID = 300000012345678
AND oh.SUBINVENTORY_CODE = 'FGI'
GROUP BY oh.INVENTORY_ITEM_ID, oh.ORGANIZATION_ID, oh.SUBINVENTORY_CODE
ORDER BY oh.INVENTORY_ITEM_IDRecent purchase order headers
SELECT poh.PO_HEADER_ID,
poh.SEGMENT1 AS PO_NUMBER,
poh.DOCUMENT_STATUS,
poh.VENDOR_ID,
poh.CREATION_DATE
FROM PO_HEADERS_ALL poh
WHERE poh.PRC_BU_ID = 300000054321000
AND poh.CREATION_DATE >= SYSDATE - 90
ORDER BY poh.CREATION_DATE DESCPO lines joined to item
SELECT poh.SEGMENT1 AS PO_NUMBER,
pol.LINE_NUM,
pol.ITEM_ID,
esib.ITEM_NUMBER,
pol.QUANTITY
FROM PO_HEADERS_ALL poh,
PO_LINES_ALL pol,
EGP_SYSTEM_ITEMS_B esib
WHERE pol.PO_HEADER_ID = poh.PO_HEADER_ID
AND esib.INVENTORY_ITEM_ID(+) = pol.ITEM_ID
AND esib.ORGANIZATION_ID(+) = 300000012345678
AND poh.PRC_BU_ID = 300000054321000
AND poh.CREATION_DATE >= SYSDATE - 90Starter SQL for BI Publisher data models, not production reports. Verify table and column names against the Tables and Views guide for your release, test with a small filter first, and remember that data security is applied by your report data model and role, not by this text.
Ask Fusion in plain English
See how ERPray answers these data questions read-only and shows the query it ran.
Optional. The tool and every export work without this. No spam.
How to use the generator
Enter your inventory organization ID, a subinventory, the procurement BU ID and a lookback window. The code blocks update instantly. Copy a block into a new SQL data set in BI Publisher and run it against a small filter first. Organization and BU IDs are numeric values from your own instance, found in setup or from a quick query on the organization tables.
- Replace sample IDs with your own
- Start with narrow filters
- Add joins one table at a time
What the queries read
EGP_SYSTEM_ITEMS_B holds item definitions by organization. INV_ONHAND_QUANTITIES_DETAIL stores on-hand balances in the primary unit of measure. PO_HEADERS_ALL and PO_LINES_ALL hold purchasing documents, with the header procurement BU in PRC_BU_ID. These are shared across modules, so confirm you are reading the right columns for your release.
Common mistakes
The most common issue is forgetting organization filters and returning every row in the instance. Second is summing quantities in mixed units of measure. Third is building reports directly on tables when a supported subject area in OTBI or a REST resource would be easier to maintain across quarterly updates.
- Always filter by organization or BU
- Check UOM before summing
- Prefer OTBI for ad hoc analysis, BIP for formatted output
Frequently Asked Questions
Can I run these in any Oracle Fusion environment?
Only where you have access to build BI Publisher data models and the right roles. Many pods restrict direct table access in production, so validate in a test environment and follow your organization's rules on custom reporting.
Why use base tables instead of OTBI?
OTBI subject areas are easier and safer for ad hoc analysis. Base table SQL gives full control and pixel perfect layouts in BI Publisher, but takes more maintenance after quarterly updates.
Where do I find my organization ID?
Query the inventory organization parameters table or use the Manage Inventory Organizations task and a REST call for details. The numeric ID differs per instance, which is why the generator uses a placeholder.
Are these queries tuned?
No. They are starting points. Check execution plans on large tables, add date and organization filters, and avoid selecting columns you do not need in production data models.
If your team writes many of these queries, we can show how a read-only AI assistant over your Fusion data answers the same questions in plain English while showing the SQL it ran.
Related Tools
Oracle Fusion SCM Terminology vs EBS Reference
Look up Fusion SCM and Manufacturing terms and see the nearest EBS concept, so EBS veterans stop mistranslating setups.
OracleOracle Fusion Data Conversion Tracker Worksheet
Track each conversion object across mock loads, with source counts, loaded counts, errors and automatic error rates.
OracleOracle Fusion Integration Design Document Template
Fill in interface details once and get a clean design document covering method, mapping, scheduling, error handling and approvals.
OracleOracle EBS Module to Fusion Cloud Product Reference
See which Oracle Fusion Cloud product replaces each E-Business Suite module, with the key change to plan for.
More Oracle tools
See all- Oracle Fusion FBDI Template Field Guide
- Oracle Fusion Item Class Design Worksheet
- Oracle Fusion Supply Planning Checklist
- Oracle Fusion BI Publisher Report Specification Template
- Oracle Fusion Quarterly Update Test Checklist
- Oracle Fusion Role Provisioning Worksheet
- Oracle Fusion Cloud SCM Fit Gap Worksheet
- Oracle Fusion Data Migration Mapping Worksheet
- Oracle Fusion Cutover Plan Worksheet
Keep exploring
Free tools
- Oracle Fusion BI Publisher Report Specification TemplateDocument a BI Publisher report before you build it: purpose, data model, parameters, layout, schedule and security in one template.
- Oracle Fusion Suppliers Table Report SQL TemplateFill in a few fields to generate a BI Publisher SQL query that reports Oracle Fusion suppliers and their sites, with notes on supplier import templates.
- Oracle Fusion Manufacturing Tables ReferenceA searchable list of the main Oracle Fusion Manufacturing tables for work orders and work definitions, with purpose, key columns and join notes for BI Publisher reports.
ERP fixes and how-tos
- How to Create a Report in Oracle FusionCreate a report in Oracle Fusion Cloud with BI Publisher: data model, layout template, security and scheduling, plus when an OTBI analysis is the faster route.
- OTBI vs BI Publisher: Which One Should You UseOTBI is for ad hoc real time analysis; BI Publisher is for scheduled, formatted documents. Here is how to choose the right Oracle Fusion reporting tool.
- Oracle Fusion: Cost Accounting Distributions Not CreatedOracle Fusion inventory transactions not costed or without distributions: check cost organization, cost book, valuation setup, missing item cost, and the processing jobs.
Runs with your ERP
- Oracle Fusion Cloud Quality Management with Fusion SCMHow Oracle Fusion Cloud Quality Management logs nonconformance against WIP, receiving and supplier records and drives CAPA: flows, setup and pitfalls.
- Oracle Fusion Cloud Maintenance with Fusion ERP and SCMHow Oracle Fusion Cloud Maintenance handles work orders, preventive maintenance and warranty on Fusion SCM: data flows, setup, pitfalls and private AI ideas.
- RFgen Mobile Foundations with Oracle Fusion Cloud SCMRFgen Mobile Foundations automates Oracle Fusion Cloud SCM warehouse and inventory transactions on barcode devices: connector, data flows, setup, pitfalls.
AI on your ERP
- AI for Oracle Cloud SCM and Manufacturing, Grounded in Your Planning DataAdd grounded AI to Oracle Cloud SCM and Fusion Manufacturing: demand plans, work orders, and supplier data, answered on-prem or in a private cloud with full query visibility.
- Fusion Cloud ERP AI: OCI Generative AI Service vs. a Private LLMHow Fusion Cloud ERP AI supports GenAI implementation: OCI Generative AI Service for Fusion-only use cases, a private LLM for sensitive or cross-system data.
Integrations
- How to connect Power BI to Oracle Fusion Cloud ERPHow to connect Power BI to Oracle Fusion Cloud ERP: BICC to a warehouse, BI Publisher and REST options, manufacturing dashboards and natural-language Q&A.
- How to connect ChatGPT to Oracle Fusion Cloud ERPHow to use ChatGPT with Oracle Fusion Cloud ERP: custom GPT actions over REST, exports versus live access, enterprise data controls and private model options.