You are not logged in.
Announcement
Unanswered posts
|
Pages: 1

Dear Experts,
I would like have two outputs say tMSSQLOutput1 and tMSSQLOutput2
and One tMSSQLInput with a tmap and I would like send all the records that to tMSSQLOutput1 based on a condition( say America region) for update only and send all the rest of the records tMSSQLOutput2.
Thx
Offline

You can use tFilterRow. You get two outputs of the component (matched and rejected). One for for your tMSSQLOuput1 and one for your tMSSQLOutput2.
Bye
Volker
Offline

Thx a bunch.. it worked.. I now need to check if the rejected records already exists in the table using a different column to match on...Appreciate your help
Offline

Hi,
some ideas:
- Check with a lookup in a tMap if the value exisits.
- Execute a predefined SQL (like "SELECT count(*) FROM table WHERE column = '" + rowN.column + "'") with a t[DB]Row
If this wouldn't help you please give some more information.
Bye
Volker
Offline
Hello itc_man
I get some java error
Please show more information about your job and what's the error information?![]()
Best regards
shong
Offline

About your compile problem:
You are using row1 in tOracleRow_1. This doesn't work.
For more info take a look at (same problem / lookup loaded outside the iteration, flow):
http://www.talendforge.org/forum/viewtopic.php?id=2676
Last edited by Volker Brehm (2008-04-18 01:08:08)
Offline

Hi, Volker
I reviewed the posting, He is using the file insteads of databases. I have seen the example of using files and it works.
In the above example I have replicated what you said
- Check with a lookup in a tMap if the value exisits.
- Execute a predefined SQL (like "SELECT count(*) FROM table WHERE column = '" + rowN.column + "'") with a t[DB]Row
it seems to be simple example. but unable to do so in talend...any Ideas.... All I want do is to execute
SELECT count(*) FROM table WHERE column = '" + rowN.column + "'" as the rows are passed from DBInputs
Offline

To go back to your original problem I would say that you could use the following solution (as example):
Read your data as is in the main flow, read the following data as lookup:
SELECT keyToMatchMainFlow, count(*) FROM table GROUP BY keyToMatchMainFlow;
Than you use a lookup in tMap with the selected key. You have than a number of rows for your data and could set a filter. Additional you can reject main rows without any lookup data (=> no data in your table for this key). If you only need the information if there is any data you can use, instead of count(*), only the key.
Bye
Volker
Offline

I believe you missed the point. I want to make sure as the rows are pass from input to transformation to output (with the commit rows = 1)...any subsequent rows coming in for processing, I would like to check for existence, processing, etc,
This a fundamental req. for a ETL tool......I have used many ETL tools like DataStage, Informatica OWB, DB2 Warehouse Edition, Data Integrator (BODI) and MSFT Integration Services and all of this fundamental feature.
Offline

Attached is the flow I want to accomplish.. anybody achived this?..Appreciate your help.
|(Lookup..check for existence)....>SQL ("SELECT count(*) FROM "TABLE_TARGET" WHERE column = '" + rowN.column + "'")
|
Source(TABLE_SOURCE) -----(rowN)-->tMap--(Insert Flow)-------> Traget("TABLE_TARGET")
\
\
\---(Update Flow)----> Traget("TABLE_TARGET")
Offline
I don't think you need a tOracleRow - I believe you should replace it with the actual table you want to do a lookup in (via another tOracleInput).
Then, on your tMap component - just drag the COL21, COL22, COL23 over to the output.
Then use a tFilter after the tMap and check to see if col22 is null (which it will be if there was no match).
The nulls will be sent to the Main flow out of the tFilter and the Rejects (the recs where the row1.COL1 exists in row2 table) can be sent somewhere else. Make sure to check the Inner Join box.
This seems to have worked well for me in the past. If I'm still unclear - let me know and I'll try to post an example for you.
Offline
Pages: 1