Query to get customer Extract:
SELECT 1 "KEY",
TRIM(HCA.ATTRIBUTE1) SFDC_ID,
HP.PARTY_NUMBER Oracle_ERP_Customer_Id,
HCA.ACCOUNT_NUMBER Oracle_ERP_Customer_Account_no,
HPS.PARTY_SITE_NUMBER Oracle_ERP_Customer_Site_no,
HCA.CUST_ACCOUNT_ID Oracle_ERP_Customer_Account_id,
HPS.PARTY_SITE_ID Oracle_ERP_Customer_Site_Id,
HCPF.EFFECTIVE_START_DATE ORACLE_ERP_CREATE_DATE,
HCPF.LAST_UPDATE_DATE ORACLE_ERP_UPDATE_DATE,
HCPF.CREDIT_RATING CREDIT_RATING,
HCPF.CREDIT_CLASSIFICATION CREDIT_CLASSIFICATION,
HCPF.CREDIT_CURRENCY_CODE CREDIT_CURRENCY_CODE, --- Rel 006
HCPF.CREDIT_LIMIT CREDIT_LIMIT,
TRIM(HCAS.ATTRIBUTE3) ORACLE_BUC_CODE,
ZPTP.REP_REGISTRATION_NUMBER ORACLE_VAT_TAX_CODE,
NULL ORACLE_TAX_JURISDICTION_CODE
FROM HZ_PARTIES HP,
HZ_PARTY_SITES HPS,
HZ_CUST_ACCOUNTS HCA,
HZ_CUST_ACCT_SITES_ALL HCAS,
HZ_CUSTOMER_PROFILES_F HCPF,
ZX_PARTY_TAX_PROFILE ZPTP
WHERE 1 =1
AND HCA.PARTY_ID = HP.PARTY_ID
AND HP.PARTY_ID = HPS.PARTY_ID
AND HCA.CUST_ACCOUNT_ID = HCAS.CUST_ACCOUNT_ID
AND HCA.CUST_ACCOUNT_ID = HCPF.CUST_ACCOUNT_ID
AND HCAS.PARTY_SITE_ID = HPS.PARTY_SITE_ID
AND ZPTP.PARTY_ID(+) = HPS.PARTY_SITE_ID
AND HCA.ATTRIBUTE1 IS NOT NULL
AND HCPF.SITE_USE_ID IS NULL
AND HCA.STATUS = 'A'
AND HP.STATUS = 'A'
AND HCAS.STATUS = 'A'
AND HPS.STATUS = 'A'
AND HCPF.STATUS = 'A'
UNION
SELECT 1 "KEY",
TRIM(HCA.ATTRIBUTE1) SFDC_ID,
HP.PARTY_NUMBER Oracle_ERP_Customer_Id,
HCA.ACCOUNT_NUMBER Oracle_ERP_Customer_Account_no,
HPS.PARTY_SITE_NUMBER Oracle_ERP_Customer_Site_no,
HCA.CUST_ACCOUNT_ID Oracle_ERP_Customer_Account_id,
HPS.PARTY_SITE_ID Oracle_ERP_Customer_Site_Id,
HCPF.EFFECTIVE_START_DATE ORACLE_ERP_CREATE_DATE,
HCPF.LAST_UPDATE_DATE ORACLE_ERP_UPDATE_DATE,
HCPF.CREDIT_RATING CREDIT_RATING,
HCPF.CREDIT_CLASSIFICATION CREDIT_CLASSIFICATION,
HCPF.CREDIT_CURRENCY_CODE CREDIT_CURRENCY_CODE, --- Rel 006
HCPF.CREDIT_LIMIT CREDIT_LIMIT,
TRIM(HCAS.ATTRIBUTE3) ORACLE_BUC_CODE,
ZPTP.REP_REGISTRATION_NUMBER ORACLE_VAT_TAX_CODE,
NULL ORACLE_TAX_JURISDICTION_CODE
FROM HZ_PARTIES HP,
HZ_PARTY_SITES HPS,
HZ_CUST_ACCOUNTS HCA,
HZ_CUST_ACCT_SITES_ALL HCAS,
HZ_CUSTOMER_PROFILES_F HCPF,
ZX_PARTY_TAX_PROFILE ZPTP
WHERE 1 =1
AND HCA.PARTY_ID = HP.PARTY_ID
AND HP.PARTY_ID = HPS.PARTY_ID
AND HCA.CUST_ACCOUNT_ID = HCAS.CUST_ACCOUNT_ID
AND HCA.CUST_ACCOUNT_ID = HCPF.CUST_ACCOUNT_ID
AND HCAS.PARTY_SITE_ID = HPS.PARTY_SITE_ID
AND ZPTP.PARTY_ID(+) = HPS.PARTY_SITE_ID
AND HCA.ATTRIBUTE1 IS NOT NULL
AND HCPF.SITE_USE_ID IS NULL
AND HCA.STATUS = 'A'
AND HP.STATUS = 'A'
AND HCAS.STATUS = 'A'
AND HPS.STATUS = 'A'
AND HCPF.STATUS = 'A'
UNION
SELECT 1 "KEY",
TRIM(HCA.ATTRIBUTE1) SFDC_ID,
HP.PARTY_NUMBER Oracle_ERP_Customer_Id,
HCA.ACCOUNT_NUMBER Oracle_ERP_Customer_Account_no,
HPS.PARTY_SITE_NUMBER Oracle_ERP_Customer_Site_no,
HCA.CUST_ACCOUNT_ID Oracle_ERP_Customer_Account_id,
HPS.PARTY_SITE_ID Oracle_ERP_Customer_Site_Id,
HCPF.EFFECTIVE_START_DATE ORACLE_ERP_CREATE_DATE,
HCPF.LAST_UPDATE_DATE ORACLE_ERP_UPDATE_DATE,
HCPF.CREDIT_RATING CREDIT_RATING,
HCPF.CREDIT_CLASSIFICATION CREDIT_CLASSIFICATION,
HCPF.CREDIT_CURRENCY_CODE CREDIT_CURRENCY_CODE, --- Rel 006
HCPF.CREDIT_LIMIT CREDIT_LIMIT,
TRIM(HCAS.ATTRIBUTE3) ORACLE_BUC_CODE,
ZPTP.REP_REGISTRATION_NUMBER ORACLE_VAT_TAX_CODE,
NULL ORACLE_TAX_JURISDICTION_CODE
FROM HZ_PARTIES HP,
HZ_PARTY_SITES HPS,
HZ_CUST_ACCOUNTS HCA,
HZ_CUST_ACCT_SITES_ALL HCAS,
HZ_CUSTOMER_PROFILES_F HCPF,
ZX_PARTY_TAX_PROFILE ZPTP
WHERE 1 =1
AND HCA.PARTY_ID = HP.PARTY_ID
AND HP.PARTY_ID = HPS.PARTY_ID
AND HCA.CUST_ACCOUNT_ID = HCAS.CUST_ACCOUNT_ID
AND HCA.CUST_ACCOUNT_ID = HCPF.CUST_ACCOUNT_ID
AND HCAS.PARTY_SITE_ID = HPS.PARTY_SITE_ID
AND ZPTP.PARTY_ID(+) = HPS.PARTY_SITE_ID
AND HCA.ATTRIBUTE1 IS NOT NULL
AND HCPF.SITE_USE_ID IS NULL
AND HCA.STATUS = 'A'
AND HP.STATUS = 'A'
AND HCAS.STATUS = 'A'
AND HPS.STATUS = 'A'
AND HCPF.STATUS = 'A'
ORDER BY ORACLE_ERP_CUSTOMER_ID DESC
SELECT 1 "KEY",
TRIM(HCA.ATTRIBUTE1) SFDC_ID,
HP.PARTY_NUMBER Oracle_ERP_Customer_Id,
HCA.ACCOUNT_NUMBER Oracle_ERP_Customer_Account_no,
HPS.PARTY_SITE_NUMBER Oracle_ERP_Customer_Site_no,
HCA.CUST_ACCOUNT_ID Oracle_ERP_Customer_Account_id,
HPS.PARTY_SITE_ID Oracle_ERP_Customer_Site_Id,
HCPF.EFFECTIVE_START_DATE ORACLE_ERP_CREATE_DATE,
HCPF.LAST_UPDATE_DATE ORACLE_ERP_UPDATE_DATE,
HCPF.CREDIT_RATING CREDIT_RATING,
HCPF.CREDIT_CLASSIFICATION CREDIT_CLASSIFICATION,
HCPF.CREDIT_CURRENCY_CODE CREDIT_CURRENCY_CODE, --- Rel 006
HCPF.CREDIT_LIMIT CREDIT_LIMIT,
TRIM(HCAS.ATTRIBUTE3) ORACLE_BUC_CODE,
ZPTP.REP_REGISTRATION_NUMBER ORACLE_VAT_TAX_CODE,
NULL ORACLE_TAX_JURISDICTION_CODE
FROM HZ_PARTIES HP,
HZ_PARTY_SITES HPS,
HZ_CUST_ACCOUNTS HCA,
HZ_CUST_ACCT_SITES_ALL HCAS,
HZ_CUSTOMER_PROFILES_F HCPF,
ZX_PARTY_TAX_PROFILE ZPTP
WHERE 1 =1
AND HCA.PARTY_ID = HP.PARTY_ID
AND HP.PARTY_ID = HPS.PARTY_ID
AND HCA.CUST_ACCOUNT_ID = HCAS.CUST_ACCOUNT_ID
AND HCA.CUST_ACCOUNT_ID = HCPF.CUST_ACCOUNT_ID
AND HCAS.PARTY_SITE_ID = HPS.PARTY_SITE_ID
AND ZPTP.PARTY_ID(+) = HPS.PARTY_SITE_ID
AND HCA.ATTRIBUTE1 IS NOT NULL
AND HCPF.SITE_USE_ID IS NULL
AND HCA.STATUS = 'A'
AND HP.STATUS = 'A'
AND HCAS.STATUS = 'A'
AND HPS.STATUS = 'A'
AND HCPF.STATUS = 'A'
UNION
SELECT 1 "KEY",
TRIM(HCA.ATTRIBUTE1) SFDC_ID,
HP.PARTY_NUMBER Oracle_ERP_Customer_Id,
HCA.ACCOUNT_NUMBER Oracle_ERP_Customer_Account_no,
HPS.PARTY_SITE_NUMBER Oracle_ERP_Customer_Site_no,
HCA.CUST_ACCOUNT_ID Oracle_ERP_Customer_Account_id,
HPS.PARTY_SITE_ID Oracle_ERP_Customer_Site_Id,
HCPF.EFFECTIVE_START_DATE ORACLE_ERP_CREATE_DATE,
HCPF.LAST_UPDATE_DATE ORACLE_ERP_UPDATE_DATE,
HCPF.CREDIT_RATING CREDIT_RATING,
HCPF.CREDIT_CLASSIFICATION CREDIT_CLASSIFICATION,
HCPF.CREDIT_CURRENCY_CODE CREDIT_CURRENCY_CODE, --- Rel 006
HCPF.CREDIT_LIMIT CREDIT_LIMIT,
TRIM(HCAS.ATTRIBUTE3) ORACLE_BUC_CODE,
ZPTP.REP_REGISTRATION_NUMBER ORACLE_VAT_TAX_CODE,
NULL ORACLE_TAX_JURISDICTION_CODE
FROM HZ_PARTIES HP,
HZ_PARTY_SITES HPS,
HZ_CUST_ACCOUNTS HCA,
HZ_CUST_ACCT_SITES_ALL HCAS,
HZ_CUSTOMER_PROFILES_F HCPF,
ZX_PARTY_TAX_PROFILE ZPTP
WHERE 1 =1
AND HCA.PARTY_ID = HP.PARTY_ID
AND HP.PARTY_ID = HPS.PARTY_ID
AND HCA.CUST_ACCOUNT_ID = HCAS.CUST_ACCOUNT_ID
AND HCA.CUST_ACCOUNT_ID = HCPF.CUST_ACCOUNT_ID
AND HCAS.PARTY_SITE_ID = HPS.PARTY_SITE_ID
AND ZPTP.PARTY_ID(+) = HPS.PARTY_SITE_ID
AND HCA.ATTRIBUTE1 IS NOT NULL
AND HCPF.SITE_USE_ID IS NULL
AND HCA.STATUS = 'A'
AND HP.STATUS = 'A'
AND HCAS.STATUS = 'A'
AND HPS.STATUS = 'A'
AND HCPF.STATUS = 'A'
UNION
SELECT 1 "KEY",
TRIM(HCA.ATTRIBUTE1) SFDC_ID,
HP.PARTY_NUMBER Oracle_ERP_Customer_Id,
HCA.ACCOUNT_NUMBER Oracle_ERP_Customer_Account_no,
HPS.PARTY_SITE_NUMBER Oracle_ERP_Customer_Site_no,
HCA.CUST_ACCOUNT_ID Oracle_ERP_Customer_Account_id,
HPS.PARTY_SITE_ID Oracle_ERP_Customer_Site_Id,
HCPF.EFFECTIVE_START_DATE ORACLE_ERP_CREATE_DATE,
HCPF.LAST_UPDATE_DATE ORACLE_ERP_UPDATE_DATE,
HCPF.CREDIT_RATING CREDIT_RATING,
HCPF.CREDIT_CLASSIFICATION CREDIT_CLASSIFICATION,
HCPF.CREDIT_CURRENCY_CODE CREDIT_CURRENCY_CODE, --- Rel 006
HCPF.CREDIT_LIMIT CREDIT_LIMIT,
TRIM(HCAS.ATTRIBUTE3) ORACLE_BUC_CODE,
ZPTP.REP_REGISTRATION_NUMBER ORACLE_VAT_TAX_CODE,
NULL ORACLE_TAX_JURISDICTION_CODE
FROM HZ_PARTIES HP,
HZ_PARTY_SITES HPS,
HZ_CUST_ACCOUNTS HCA,
HZ_CUST_ACCT_SITES_ALL HCAS,
HZ_CUSTOMER_PROFILES_F HCPF,
ZX_PARTY_TAX_PROFILE ZPTP
WHERE 1 =1
AND HCA.PARTY_ID = HP.PARTY_ID
AND HP.PARTY_ID = HPS.PARTY_ID
AND HCA.CUST_ACCOUNT_ID = HCAS.CUST_ACCOUNT_ID
AND HCA.CUST_ACCOUNT_ID = HCPF.CUST_ACCOUNT_ID
AND HCAS.PARTY_SITE_ID = HPS.PARTY_SITE_ID
AND ZPTP.PARTY_ID(+) = HPS.PARTY_SITE_ID
AND HCA.ATTRIBUTE1 IS NOT NULL
AND HCPF.SITE_USE_ID IS NULL
AND HCA.STATUS = 'A'
AND HP.STATUS = 'A'
AND HCAS.STATUS = 'A'
AND HPS.STATUS = 'A'
AND HCPF.STATUS = 'A'
ORDER BY ORACLE_ERP_CUSTOMER_ID DESC
No comments:
Post a Comment