Oracle EBS SQL Query Generator for Items and WIP Jobs
Support analysts and report developers on Oracle EBS write the same few queries again and again: item master lookups, open jobs and on-hand by subinventory. This generator fills in the joins and filters so you start from a working statement.
Fill in
ORGANIZATION_ID from MTL_PARAMETERS
Use % as wildcard
3 is Released
Item master query
SELECT msib.inventory_item_id,
msib.segment1 AS item_number,
msib.description,
msib.primary_uom_code,
msib.planning_make_buy_code,
msib.inventory_item_status_code
FROM mtl_system_items_b msib
WHERE msib.organization_id = 207
AND msib.segment1 LIKE 'PUMP%'
ORDER BY msib.segment1;Discrete jobs query
SELECT we.wip_entity_name AS job_name,
msib.segment1 AS assembly,
wdj.status_type,
wdj.class_code,
wdj.start_quantity,
wdj.quantity_completed,
wdj.quantity_scrapped,
wdj.scheduled_start_date,
wdj.scheduled_completion_date
FROM wip_discrete_jobs wdj
JOIN wip_entities we
ON we.wip_entity_id = wdj.wip_entity_id
AND we.organization_id = wdj.organization_id
JOIN mtl_system_items_b msib
ON msib.inventory_item_id = wdj.primary_item_id
AND msib.organization_id = wdj.organization_id
WHERE wdj.organization_id = 207
AND wdj.status_type = 3
AND msib.segment1 LIKE 'PUMP%'
AND wdj.scheduled_start_date BETWEEN TO_DATE('2026-10-01', 'YYYY-MM-DD')
AND TO_DATE('2026-12-31', 'YYYY-MM-DD')
ORDER BY wdj.scheduled_start_date;On-hand by subinventory
SELECT msib.segment1 AS item_number,
moqd.subinventory_code,
SUM(moqd.transaction_quantity) AS on_hand_qty
FROM mtl_onhand_quantities_detail moqd
JOIN mtl_system_items_b msib
ON msib.inventory_item_id = moqd.inventory_item_id
AND msib.organization_id = moqd.organization_id
WHERE moqd.organization_id = 207
AND moqd.subinventory_code = 'STORES'
AND msib.segment1 LIKE 'PUMP%'
GROUP BY msib.segment1, moqd.subinventory_code
ORDER BY msib.segment1;These queries are read-only SELECT statements. Test them on a non-production instance or a read-only schema first. Table and column names are standard for 11i and R12, but verify them in your version, apply the right operating unit or organization security, and never write to these tables directly.
Ask your EBS data in plain English
Optional: see how a read-only assistant answers these questions and shows you the SQL it used.
Optional. The tool and every export work without this. No spam.
How to use this generator
Enter your organization ID, an item pattern, a job status and a date range, and the SQL updates immediately. Copy it into SQL Developer, TOAD or a custom report. Find the ORGANIZATION_ID by querying MTL_PARAMETERS for your organization code. Use the status code from the discrete job statuses reference to filter for released, complete or on-hold jobs.
How the queries are built
MTL_SYSTEM_ITEMS_B holds one row per item per organization, so every join must include ORGANIZATION_ID as well as INVENTORY_ITEM_ID. WIP_DISCRETE_JOBS holds the job data, and WIP_ENTITIES provides the job name. On-hand quantity is the sum of MTL_ONHAND_QUANTITIES_DETAIL rows, which are held at lot, locator and subinventory level.
- Always join items by item ID and organization ID
- Join WIP_ENTITIES for the job name
- Sum on-hand detail for quantity
- Use views such as MTL_ITEM_QUANTITIES where you can
Performance and safety
Filter on the organization first, and avoid unbounded queries over transaction tables. In production, prefer a read-only reporting replica or a restricted schema so your queries cannot interfere with the Cost Manager or WIP processing. Where supported, use the seeded views, which respect multi-org and security setups better than raw tables.
Common mistakes
Omitting the organization join is the biggest error, as it multiplies rows across plants. Another is comparing STATUS_TYPE to text instead of the numeric code. Finally, people sometimes update tables to fix a status, which bypasses validation and accounting. Use the application forms or supported APIs for changes.
Frequently Asked Questions
How do I find the organization ID in Oracle EBS?
Query MTL_PARAMETERS by ORGANIZATION_CODE to get ORGANIZATION_ID. You can also see it in HR organization definitions. Use the ID in all item and WIP queries.
Why do I get duplicate item rows?
MTL_SYSTEM_ITEMS_B has a row for each organization. If you do not filter or join on ORGANIZATION_ID, the same item appears once per plant.
Is it safe to run these on production?
They are read-only, but heavy queries can still affect performance. Run them during quiet hours, add filters, or use a read-only replica if your team has one.
Does it work on R12 and 12.2?
The tables used are present in both 11i and R12, including 12.2. Multi-org and edition-based changes can affect some views, so verify in your own instance.
If you want to ask these questions in plain English instead of writing SQL, we can set up a read-only assistant over your EBS data that shows the query it ran.
Related Tools
Oracle EBS Discrete Job Statuses Reference
Look up every Oracle WIP discrete job status, its numeric code, what transactions it allows and the usual next step.
OracleOracle EBS Item Attribute Template Worksheet
Plan item master attribute values for a new item template, with the underlying MTL_SYSTEM_ITEMS_B column for each attribute.
OracleOracle EBS Inventory Transaction Types Reference
Quick lookup of common Oracle Inventory transaction types, their IDs, source types and effect on on-hand quantity.
OracleOracle EBS WIP Accounting Class Reference
Understand Oracle WIP accounting class types and which valuation and variance accounts each class uses.
More Developer Tools tools
See all- SAP Sales Order ABAP SELECT Generator (VBAK, VBAP, VBFA)
- SAP Sales Order Create BAPI ABAP Generator (BAPI_SALESORDER_CREATEFROMDAT2)
- SAP ABAP Open Items SELECT Generator
- SAP ACDOCA SQL Query Generator
- SAP QM Inspection Lot ABAP SELECT Generator
- SAP Quality Notification Pareto SQL Query Generator
- SAP QM Usage Decision BAPI Skeleton
- ABAP Custom Exception Class Generator
- ABAP Unit Test Class Generator
New to Oracle E-Business Suite? Start with the Oracle E-Business Suite guide and toolkit, or plan with Oracle EBS Roadmap Planner, Training Path Builder, ERP Certification Study Planner.
Keep exploring
Free tools
- Oracle EBS WIP Tables ReferenceLookup of Oracle EBS Work in Process tables with purpose and key columns, covering discrete jobs, operations, requirements, resources and interfaces.
- Oracle EBS Cost Management Tables ReferenceA lookup of the Oracle EBS tables behind item cost, WIP jobs, BOM, routing and inventory transactions used in manufacturing costing.
- Oracle EBS On-Hand Reconciliation SQL GeneratorGenerate a SQL query that compares on-hand quantity to the net of material transactions for an organization, to spot unexplained differences.
ERP fixes and how-tos
- Oracle Work Order Tables: WIP_ENTITIES, WIP_DISCRETE_JOBS and the REST RouteOracle work order tables explained: WIP_ENTITIES, WIP_DISCRETE_JOBS, operations and requirements, with a join query for EBS and the Fusion REST route.
- How to Create an Item in Oracle EBSCreate an inventory item in Oracle EBS: Master Items form, master organization, templates, attributes, organization assignment, categories and common errors.
- Oracle EBS Outside Processing and Production SchedulingSet up outside processing in Oracle EBS WIP and Purchasing: OSP items, resources, departments, routing and requisitions, plus how discrete job scheduling works.
Runs with your ERP
- Esker Order Management and Oracle E-Business SuiteHow Esker captures customer POs from email, fax and PDF and creates sales orders in Oracle EBS: integration, data flows, setup, pitfalls and a private AI layer.
- Cloud Inventory (DSI) with Oracle E-Business Suite: Mobile Barcode InventoryCloud Inventory, formerly DSI, adds offline mobile barcode inventory to Oracle E-Business Suite and JD Edwards. Data flows, setup steps, pitfalls and AI notes.
- BarTender and Oracle E-Business Suite: Label Printing from OracleHow BarTender prints labels from Oracle EBS using Oracle XML print requests and Integration Builder: methods, data flows, setup steps, pitfalls and AI help.
AI on your ERP
- AI for Oracle EBS in Industrial Manufacturing: WIP, MRP, and BOM Questions Answered DirectlyAI for Oracle E-Business Suite in industrial manufacturing: WIP jobs, BOMs, MRP, inventory and purchasing answered in plain English, private and read-only.
- AI for Oracle E-Business Suite, Without Leaving On-PremHosting Oracle EBS 12.2 on-prem or in a private cloud? Add a private LLM over concurrent programs, interface tables and AP/PO data without moving to Fusion.
Integrations
- How to build a mobile app for Oracle E-Business SuiteBuild a shop-floor or field mobile app for Oracle E-Business Suite: barcode scanning, WIP and inventory moves, approvals and offline use over ISG and supported APIs.
- How to use ChatGPT with Oracle E-Business SuiteUsing ChatGPT with Oracle E-Business Suite: export vs live access, custom GPT actions over ISG REST, enterprise data controls and when to keep data on-prem.