Query-Customer phone number
SELECT raw_phone_number
-- INTO x_shipto_contact
FROM hz_contact_points hcp,
hz_party_sites hps,
hz_cust_acct_sites_all hcas,
hz_cust_site_uses_all hcsu
WHERE hcp.owner_table_id = hps.party_site_id
AND hps.party_site_id = hcas.party_site_id
AND hcas.cust_acct_site_id = hcsu.cust_acct_site_id
AND hcsu.site_use_code = 'SHIP_TO'
AND hcas.cust_acct_site_id =
cust_accounts_rec.cust_acct_site_id --6587
AND hcp.STATUS = 'A'
AND hcp.owner_table_name = 'HZ_PARTY_SITES'
AND hcp.contact_point_type = 'PHONE'
AND phone_line_type = 'GEN';
--if top one is blank
SELECT hcp.raw_phone_number
-- INTO x_shipto_contact
FROM hz_contact_points hcp,
hz_parties hp,
hz_cust_accounts_all hca
WHERE hca.party_id = hcp.owner_table_id
AND hp.party_id = hca.party_id
AND hca.party_id = hcp.owner_table_id
AND hcp.owner_table_name = 'HZ_PARTIES'
AND hcp.contact_point_type = 'PHONE'
AND phone_line_type = 'GEN'
AND hcp.STATUS = 'A'
AND hca.cust_account_id =
cust_accounts_rec.oracle_customer_id;
No comments:
Post a Comment