忙里偷闲

很多事情很多心情写了也就记下了; 不写,以后可能就忘了.
个人资料
正文

Query to extract the language set on customer sites within all o

(2009-08-04 12:41:36) 下一个

SELECT ADDR.ORG_ID,
          ADDR.CUST_ACCOUNT_ID CUSTOMER_ID ,
          ADDR.CUST_ACCT_SITE_ID ADDRESS_ID ,
          LOC.COUNTRY COUNTRY ,
          LOC.LANGUAGE LANGUAGE ,
          substr(cus.customer_name,1,50), 
          CUS.customer_number,
         LOC.LANGUAGE 
FROM HZ_LOCATIONS LOC,
         HZ_CUST_ACCT_SITES_ALL ADDR,
        AR_LOOKUPS L_CAT,
        HZ_PARTY_SITES PARTY_SITE,
        HZ_LOC_ASSIGNMENTS LOC_ASSIGN,
        ar_customers_v cus,
        hz_cust_site_uses_all su,
        hz_cust_acct_sites_all cas
where ADDR.CUSTOMER_CATEGORY_CODE = L_CAT.LOOKUP_CODE(+)
AND L_CAT.LOOKUP_TYPE(+) = 'ADDRESS_CATEGORY'
AND ADDR.PARTY_SITE_ID = PARTY_SITE.PARTY_SITE_ID
AND LOC.LOCATION_ID = PARTY_SITE.LOCATION_ID
AND LOC.LOCATION_ID = LOC_ASSIGN.LOCATION_ID
AND ADDR.CUST_ACCOUNT_ID = cus.customer_id
AND su.site_use_code = 'BILL_TO'
AND su.cust_acct_site_id = cas.cust_acct_site_id
AND cas.party_site_id = addr.party_site_id
AND NVL(ADDR.ORG_ID, -99) = NVL(LOC_ASSIGN.ORG_ID, -99)
AND NVL(ADDR.ORG_ID, -99) = NVL(su.ORG_ID, -99)
AND NVL(cas.ORG_ID, -99) = NVL(su.ORG_ID, -99)
ORDER BYcustomer_id

This is useful if we need to generate invoice in language set on customer ‘bill to’ site.

[ 打印 ]
阅读 ()评论 (2)
评论
目前还没有任何评论
登录后才可评论.