DBA Data[Home] [Help]

VIEW: APPS.ARI_CUSTOMER_SEARCH_V

Source

View Text - Preformatted

SELECT cust.cust_account_id customer_id, 'ADDR' details_level, cust.account_number customer_number, party.party_name customer_name, addr.cust_acct_site_id address_id, arp_addr_pkg.format_address(loc.address_style, loc.address1, loc.address2, loc.address3, loc.address4, loc.city, loc.county, loc.state, loc.province, loc.postal_code, terr.territory_short_name) concatenated_address, to_char(NULL) contact_name, to_char(NULL) contact_phone, -1 bill_to_site_use_id, to_char(NULL) site_uses, addr.org_id FROM hz_cust_accounts cust, hz_parties party, hz_cust_acct_sites addr, hz_party_sites party_site, hz_locations loc, fnd_territories_tl terr WHERE addr.cust_account_id = cust.cust_account_id AND cust.party_id = party.party_id AND addr.party_site_id = party_site.party_site_id AND loc.location_id = party_site.location_id AND loc.country = terr.territory_code(+) AND terr.language(+) = USERENV('LANG') UNION SELECT cust.cust_account_id customer_id, 'CUST' details_level, cust.account_number customer_number, party.party_name customer_name, -1 address_id, 'ALL_LOCATIONS' concatenated_address, to_char(NULL) contact_name, to_char(NULL) contact_phone, -1 bill_to_site_use_id, to_char(NULL) site_uses, -1 org_id FROM hz_cust_accounts cust, hz_parties party WHERE cust.party_id = party.party_id
View Text - HTML Formatted

SELECT CUST.CUST_ACCOUNT_ID CUSTOMER_ID
, 'ADDR' DETAILS_LEVEL
, CUST.ACCOUNT_NUMBER CUSTOMER_NUMBER
, PARTY.PARTY_NAME CUSTOMER_NAME
, ADDR.CUST_ACCT_SITE_ID ADDRESS_ID
, ARP_ADDR_PKG.FORMAT_ADDRESS(LOC.ADDRESS_STYLE
, LOC.ADDRESS1
, LOC.ADDRESS2
, LOC.ADDRESS3
, LOC.ADDRESS4
, LOC.CITY
, LOC.COUNTY
, LOC.STATE
, LOC.PROVINCE
, LOC.POSTAL_CODE
, TERR.TERRITORY_SHORT_NAME) CONCATENATED_ADDRESS
, TO_CHAR(NULL) CONTACT_NAME
, TO_CHAR(NULL) CONTACT_PHONE
, -1 BILL_TO_SITE_USE_ID
, TO_CHAR(NULL) SITE_USES
, ADDR.ORG_ID
FROM HZ_CUST_ACCOUNTS CUST
, HZ_PARTIES PARTY
, HZ_CUST_ACCT_SITES ADDR
, HZ_PARTY_SITES PARTY_SITE
, HZ_LOCATIONS LOC
, FND_TERRITORIES_TL TERR
WHERE ADDR.CUST_ACCOUNT_ID = CUST.CUST_ACCOUNT_ID
AND CUST.PARTY_ID = PARTY.PARTY_ID
AND ADDR.PARTY_SITE_ID = PARTY_SITE.PARTY_SITE_ID
AND LOC.LOCATION_ID = PARTY_SITE.LOCATION_ID
AND LOC.COUNTRY = TERR.TERRITORY_CODE(+)
AND TERR.LANGUAGE(+) = USERENV('LANG') UNION SELECT CUST.CUST_ACCOUNT_ID CUSTOMER_ID
, 'CUST' DETAILS_LEVEL
, CUST.ACCOUNT_NUMBER CUSTOMER_NUMBER
, PARTY.PARTY_NAME CUSTOMER_NAME
, -1 ADDRESS_ID
, 'ALL_LOCATIONS' CONCATENATED_ADDRESS
, TO_CHAR(NULL) CONTACT_NAME
, TO_CHAR(NULL) CONTACT_PHONE
, -1 BILL_TO_SITE_USE_ID
, TO_CHAR(NULL) SITE_USES
, -1 ORG_ID
FROM HZ_CUST_ACCOUNTS CUST
, HZ_PARTIES PARTY
WHERE CUST.PARTY_ID = PARTY.PARTY_ID