P. 1
Query to provide 11i Customer and Address for an Order

Query to provide 11i Customer and Address for an Order

|Views: 34|Likes:
Published by Radhe Lanka
Oracle 11i Sqls
Oracle 11i Sqls

More info:

Categories:Types, Reviews
Published by: Radhe Lanka on Feb 19, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as TXT, PDF, TXT or read online from Scribd
See more
See less

05/12/2014

pdf

text

original

/*Query to provide 11i Customer and Address information for a given order number

*/

--Query to provide Ship-to Customer and Address information select ooha.order_number, oola.line_number, ooha.cust_po_number, ooha.org_id, hps.party_site_id, --hps.org_id, hp.party_name CUST_NAME, hca.account_number CUST_NUM, hl.country, hl.address1, hl.address2, hl.address3, hl.address4, hl.city, hl.postal_code, hl.state, hl.province, hl.county from apps.hz_locations hl, apps.hz_parties hp, apps.hz_party_sites hps, apps.hz_cust_accounts hca, apps.hz_cust_acct_sites_all hcasa, apps.hz_cust_site_uses_all hcsua, apps.oe_order_lines_all oola, apps.oe_order_headers_all ooha where hps.location_id = hl.location_id and hps.party_id = hp.party_id and hcasa.party_site_id = hps.party_site_id and hcasa.cust_account_id = hca.cust_account_id and hcsua.cust_acct_site_id = hcasa.cust_acct_site_id and ooha.ship_to_org_id = hcsua.site_use_id and ooha.header_id = oola.header_id and ooha.order_number = 2418782 --Query to provide the Sold-To Customer Name for a given SO number select hp.party_name CUSTOMER_NAME from apps.hz_parties hp, apps.hz_cust_accounts hca, apps.oe_order_headers_all ooha where 1=1 and hca.party_id = hp.party_id and ooha.sold_to_org_id = hca.cust_account_id and ooha.order_number = 2043133 --Query to provide Bill-to Customer and Address information select ooha.order_number, oola.line_number, hp.party_name CUST_NAME, hca.account_number CUST_NUM, hl.country, hl.address1, hl.address2, hl.address3,

from

where and and and and and and and

hl.address4, hl.city, hl.postal_code, hl.state, hl.province, hl.county apps.hz_locations hl, apps.hz_parties hp, apps.hz_party_sites hps, apps.hz_cust_accounts hca, apps.hz_cust_acct_sites_all hcasa, apps.hz_cust_site_uses_all hcsua, apps.oe_order_lines_all oola, apps.oe_order_headers_all ooha hps.location_id = hl.location_id hps.party_id = hp.party_id hcasa.party_site_id = hps.party_site_id hcasa.cust_account_id = hca.cust_account_id hcsua.cust_acct_site_id = hcasa.cust_acct_site_id ooha.invoice_to_org_id = hcsua.site_use_id ooha.header_id = oola.header_id ooha.order_number = 2060228

--Query to provide End-Customer and Address information select ooha.order_number, hp.party_name CUST_NAME, hca.account_number CUST_NUM, hl.country, hl.address1, hl.address2, hl.address3, hl.address4, hl.city, hl.postal_code, hl.state, hl.province, hl.county from apps.hz_locations hl, apps.hz_parties hp, apps.hz_party_sites hps, apps.hz_cust_accounts hca, apps.hz_cust_acct_sites_all hcasa, apps.hz_cust_site_uses_all hcsua, apps.oe_order_headers_all ooha where hps.location_id = hl.location_id and hps.party_id = hp.party_id and hcasa.party_site_id = hps.party_site_id and hcasa.cust_account_id = hca.cust_account_id and hcsua.cust_acct_site_id = hcasa.cust_acct_site_id and ooha.end_customer_site_use_id = hcsua.site_use_id and ooha.order_number = 2069134 select * from apps.hz_cust_accounts select * from apps.hz_cust_acct_sites_all select * from apps.hz_cust_site_uses_all

where site_use_id = 251473 select * from apps.po_location_associations_all where site_use_id = 251473 select * from apps.hr_locations where location_id in (345032,361678) select * from apps.hz_parties where party_id = 17638

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->