Sales Order Query
--Query to get quote number in Sales Order Table
select quote_number,flow_status_code,a.* from oe_order_headers_all a
where 1=1 and order_number=4800785
ORDER BY CREATION_DATE DESC
--Line Table
select flow_status_code, a.LINE_CATEGORY_CODE, a.* from oe_order_lines_all a
where header_id=42137275
--Delivery Detail Table
select a.RELEASED_STATUS,a.* from wsh_delivery_details a
where source_header_id=213727
--Delivery assignment Table
select * from wsh_delivery_assignments
where DELIVERY_DETAIL_ID =43978725
--Delivery Table
select * from wsh_new_deliveries
where source_header_id=42137275
--MTL Demand Table
select * from mtl_demand
where DEMAND_SOURCE_line_ID=418307
--Reservation Tab
select * from mtl_reservations
where DEMAND_SOURCE_line_ID =541830743
--Query toget Order WF Details
SELECT h.header_id, l.line_id, l.org_id,h.order_number
FROM oe_order_headers_all h,
oe_order_lines_all x,
wf_item_activity_statuses wias,
wf_process_activities wpa
WHERE h.header_id = l.header_id
AND h.org_id = l.org_id
AND NVL (h.transaction_phase_code, 'F') = 'F'
AND h.open_flag = 'Y'
AND l.open_flag = 'Y'
AND l.line_category_code <> 'RETURN'
AND l.item_type_code <> 'SERVICE'
AND l.source_type_code <> 'EXTERNAL'
AND h.order_number >= :order_number_low
AND h.order_number <= :order_number_high
AND wias.item_type = 'OEOL'
AND wias.process_activity = wpa.instance_id
AND wpa.activity_item_type = 'OEOL'
AND wpa.activity_name = 'SCHEDULING_ELIGIBLE'
AND wias.activity_status = 'NOTIFIED'
AND wias.item_key = TO_CHAR (l.line_id)
ORDER BY l.org_id, l.top_model_line_id, l.line_id
--Transaction Account from SO Link
SELECT * FROM mtl_transaction_accounts mtaWHERE transaction_id IN ( SELECT transaction_id FROM mtl_material_transactions
WHERE trx_source_line_id IN (SELECT line_id FROM oe_order_lines_all WHERE header_id =1333 ))
--AR Invoice Header Table
select * from ra_customer_trx_all a