忙裏偷閑

很多事情很多心情寫了也就記下了; 不寫,以後可能就忘了.
個人資料
正文

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)
評論
目前還沒有任何評論
登錄後才可評論.