Friday, November 2, 2018

Order Header Details Script

Order Header Details Script

This script can be used to extract order header details from backend.
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 1 = 1
   AND 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 = &Order_number

No comments:

Post a Comment

SQL Important Queries

  How to delete rows with no where clause The following example deletes  all rows  from the  Person.Person  the table in the AdventureWork...