Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I am trying to load data from two different databases with same table structure and column names.
My script as follows:
ODBC CONNECT TO [PT1025;DBQ=PT1025.IKEADT.COM] (XUserId is afMJeBdJTSdA, XPassword is ZBJfUBdJTaNOTbYW);
EU:
SQL SELECT CUSORD_NO,CUSORD_STAT,CUSORD_DATE,CUST_NO,CUS_NAME,CTY_CODE,USER_ID_REF
FROM COS."CUSTOMER_ORDER" WHERE CUSORD_STAT='00' AND TO_DATE(TO_CHAR(CUSORD_DATE,'MM/DD/YYYY'),'MM/DD/YYYY')>= TO_DATE('$(vToday)','MM/DD/YYYY');
ODBC CONNECT TO [PT1028;DBQ=PT1028.IKEADT.COM] (XUserId is VQZJaBdJTCBB, XPassword is efCcYBdJTaNOTbEE);
EUX:
SQL SELECT CUSORD_NO,CUSORD_STAT,CUSORD_DATE,CUST_NO,CUS_NAME,CTY_CODE,USER_ID_REF
FROM COS."CUSTOMER_ORDER" WHERE CUSORD_STAT='00' AND TO_DATE(TO_CHAR(CUSORD_DATE,'MM/DD/YYYY'),'MM/DD/YYYY')>= TO_DATE('$(vToday)','MM/DD/YYYY');
However, I could see that after reload only the first table got loaded. I have no idea why the second table is not loading. Any thoughts ?
Try like this :
Add an additional column with the source info as below , when want only data from one table apply this filter and you will get it
ODBC CONNECT TO [PT1025;DBQ=PT1025.IKEADT.COM] (XUserId is afMJeBdJTSdA, XPassword is ZBJfUBdJTaNOTbYW);
EU:
SQL SELECT
'EU' as Source ,
CUSORD_NO,CUSORD_STAT,CUSORD_DATE,CUST_NO,CUS_NAME,CTY_CODE,USER_ID_REF
FROM COS."CUSTOMER_ORDER" WHERE CUSORD_STAT='00' AND TO_DATE(TO_CHAR(CUSORD_DATE,'MM/DD/YYYY'),'MM/DD/YYYY')>= TO_DATE('$(vToday)','MM/DD/YYYY');
ODBC CONNECT TO [PT1028;DBQ=PT1028.IKEADT.COM] (XUserId is VQZJaBdJTCBB, XPassword is efCcYBdJTaNOTbEE);
EUX:
SQL SELECT
'EUX' as Source ,
CUSORD_NO,CUSORD_STAT,CUSORD_DATE,CUST_NO,CUS_NAME,CTY_CODE,USER_ID_REF
FROM COS."CUSTOMER_ORDER" WHERE CUSORD_STAT='00' AND TO_DATE(TO_CHAR(CUSORD_DATE,'MM/DD/YYYY'),'MM/DD/YYYY')>= TO_DATE('$(vToday)','MM/DD/YYYY');
Ronald is there any ref. manual for source-field ? please share if u have
Hi Saimeenakshi,
I'm not sure I understand you.
We are just adding a field (named "Source" but could be just as well "WhichDB") to every record we load. In all records from the first DB, we fill it with "EU" (because that is what you named your first table, but it could be anything). In all records from the second DB, we fill it with "EUX".
ohhhhh! I got you meant "Qualify" and "Unqualify" clauses
There you go!