Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How do I do this in Talend Studio? What components will allow me to get the desired results?[color=#000000][font=Arial, Helvetica, sans-serif] I expect there is a recommend method to accomplish this task. [/font][/color]
I want to create a CSV file with data always from table A. Also based on a value in each row from table A get a row from table B or C. There are 2 values of concern in table A. ID and alternate number (alt_no). In all cases there will be a row in B where A.ID = A.ID Yet when A.alt_no is > 0 [color=#000000][font=Arial, Helvetica, sans-serif] we want values from the alternate table C where C.ID = A.ID and C.alt_no = A.alt_no. Furthermore the CSV file will have 1 column from table B or C. For example get the value for CSV column name city from B or C depending on which one was used. [/font][/color]
My 1st idea is to use tJDBCInput for the 3 tables and have them go into tMap. Then use the expression editor to select the desired rows with a left outer join. I have not discovered a way to build the expression to work this way.
Talend integration cloud SaaS edition of Talend studio version 6.3
SELECT A.*, B.CITY
FROM TABLEA A
INNER JOIN TABLEB B
ON A.ID = B.ID
WHERE A.ALT_NO <= 0
UNION ALL
SELECT A.*, C.CITY
FROM TABLEA A
INNER JOIN TABLEC C
ON A.ID = C.ID
AND A.ALT_NO = C.ALT_NO
WHERE A.ALT_NO > 0
I want to create a CSV file with data always from table A. Also based on a value in each row from table A get a row from table B or C. There are 2 values of concern in table A. ID and alternate number (alt_no). In all cases there will be a row in B where A.ID = A.ID Yet when A.alt_no is > 0 we want values from the alternate table C where C.ID = A.ID and C.alt_no = A.alt_no. Furthermore the CSV file will have 1 column from table B or C. For example get the value for CSV column name city from B or C depending on which one was used.
SELECT A.*, B.CITY
FROM TABLEA A
INNER JOIN TABLEB B
ON A.ID = B.ID
WHERE A.ALT_NO <= 0
UNION ALL
SELECT A.*, C.CITY
FROM TABLEA A
INNER JOIN TABLEC C
ON A.ID = C.ID
AND A.ALT_NO = C.ALT_NO
WHERE A.ALT_NO > 0