Search This Blog

Thursday, November 25, 2010

Script to get Order Header details

SELECT ra.customer_number,
        hl.address1,
        hl.address2,
        hl.city,
        hl.state,
        hl.postal_code,
        hl.country,
        hl.province,
        hl.county
  FROM oe_order_headers_all ooh,
       hz_cust_site_uses_all hcsu,
       hz_cust_acct_sites_all hcas,
       hz_party_sites hps,
       hz_locations hl,
       ra_customers ra
 WHERE ooh.invoice_to_org_id = hcsu.site_use_id
   AND hcsu.cust_acct_site_id = hcas.cust_acct_site_id
   AND hcas.party_site_id = hps.party_site_id
   AND hps.location_id = hl.location_id
   AND hcas.cust_account_id = ra.customer_id
   AND order_number = :p_order_num

No comments:

Post a Comment