SELECT site_use_id
FROM apps.hz_parties hz,
apps.hz_cust_accounts hzc,
apps.hz_cust_acct_sites_all hzcs,
apps.hz_cust_site_uses_all hzcsu,
apps.hz_party_sites hps,
apps.hz_locations hl
WHERE hzc.party_id = hz.party_id
AND hzcs.cust_account_id = hzc.cust_account_id
AND hzcsu.cust_acct_site_id = hzcs.cust_acct_site_id
AND hl.location_id = hps.location_id
AND hps.party_site_id = hzcs.party_site_id
AND hps.party_id = hz.party_id
AND hz.status = 'A'
AND hzc.status = 'A'
AND hzcs.status = 'A'
AND hzcsu.status = 'A'
AND hzcsu.org_id = p_org_id
AND hzc.cust_account_id = p_customer_id
AND UPPER (hzcsu.site_use_code) = UPPER (p_site_use_code)
AND UPPER(hzcsu.location) = UPPER (p_site_num);
FROM apps.hz_parties hz,
apps.hz_cust_accounts hzc,
apps.hz_cust_acct_sites_all hzcs,
apps.hz_cust_site_uses_all hzcsu,
apps.hz_party_sites hps,
apps.hz_locations hl
WHERE hzc.party_id = hz.party_id
AND hzcs.cust_account_id = hzc.cust_account_id
AND hzcsu.cust_acct_site_id = hzcs.cust_acct_site_id
AND hl.location_id = hps.location_id
AND hps.party_site_id = hzcs.party_site_id
AND hps.party_id = hz.party_id
AND hz.status = 'A'
AND hzc.status = 'A'
AND hzcs.status = 'A'
AND hzcsu.status = 'A'
AND hzcsu.org_id = p_org_id
AND hzc.cust_account_id = p_customer_id
AND UPPER (hzcsu.site_use_code) = UPPER (p_site_use_code)
AND UPPER(hzcsu.location) = UPPER (p_site_num);
No comments:
Post a Comment
Note: only a member of this blog may post a comment.