Sie sind auf Seite 1von 2

SET pagesize 50000

SET LINESIZE 2000


SET heading off
SELECT /*csv*/ order_number
||','
||creation_date
||','
||customer_number
||','
||customer_name
||','
||order_category_code
||','
||operating_unit
||','
||pricelist
||','
||order_status
||','
||line_id
||','
||line_number
||','
||ordered_item
||','
||ordered_quantity
||','
||cancelled_quantity
||','
||unit_selling_price
||','
||tax_code
||','
||Currency
||','
||Shipping_Method
||','
||line_status
||','
||warehouse
FROM
(SELECT ooha.order_number,
TO_CHAR(ooha.creation_date,'DD-MON-YY') creation_date,
hca.account_number customer_number,
hca.account_name customer_name,
otta.order_category_code,
hou.name operating_unit,
qph.name pricelist,
ooha.flow_status_code order_status,
oola.line_id,
oola.line_number,
oola.ordered_item,
oola.ordered_quantity,
oola.cancelled_quantity,
oola.unit_selling_price,
oola.tax_code ,
ooha.transactional_curr_code AS Currency,
ooha.freight_carrier_code AS Shipping_Method,
oola.flow_status_code line_status,
mp.organization_code warehouse
FROM apps.oe_order_headers_all ooha,
apps.fnd_user fu,
apps.oe_order_lines_all oola,
apps.hr_operating_units hou,
apps.qp_list_headers_all qph,
apps.hz_cust_accounts_all hca,
apps.oe_transaction_types_all otta,
apps.mtl_parameters mp
WHERE 1 =1
AND ooha.header_id = oola.header_id
AND mp.organization_id = oola.ship_from_org_id
AND hou.organization_id = ooha.org_id
AND ooha.price_list_id = qph.list_header_id
AND ooha.sold_to_org_id = hca.cust_account_id
AND ooha.order_type_id = otta.transaction_type_id
AND ooha.created_by = fu.user_id
-- AND ooha.order_number =4721
and rownum<=50
)
/

Das könnte Ihnen auch gefallen