• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » java tmap tOracleOutput, tMSSQLOutput etc.,

#1 2008-04-15 15:03:06

johnvkumar
Member
Registered: 2008-03-20
Posts: 22

java tmap tOracleOutput, tMSSQLOutput etc.,

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

#2 2008-04-15 21:28:21

Volker Brehm
Member
Registered: 2007-04-03
Posts: 1139
Website

Re: java tmap tOracleOutput, tMSSQLOutput etc.,

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

#3 2008-04-16 14:11:46

johnvkumar
Member
Registered: 2008-03-20
Posts: 22

Re: java tmap tOracleOutput, tMSSQLOutput etc.,

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

#4 2008-04-16 21:33:10

Volker Brehm
Member
Registered: 2007-04-03
Posts: 1139
Website

Re: java tmap tOracleOutput, tMSSQLOutput etc.,

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

#5 2008-04-17 04:19:44

itc_man
Member
Registered: 2008-04-16
Posts: 11

Re: java tmap tOracleOutput, tMSSQLOutput etc.,

I get some java error

Offline

#6 2008-04-17 04:56:26

shong
Talend team
Registered: 2007-08-29
Posts: 10350
Website

Re: java tmap tOracleOutput, tMSSQLOutput etc.,

Hello itc_man

I get some java error

Please show more information about your job and what's the error information?smile

Best regards

         shong


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

#7 2008-04-17 14:27:48

itc_man
Member
Registered: 2008-04-16
Posts: 11

Re: java tmap tOracleOutput, tMSSQLOutput etc.,

Thx for your help Attached are the pics


Uploaded Images

Offline

#8 2008-04-18 00:28:59

itc_man
Member
Registered: 2008-04-16
Posts: 11

Re: java tmap tOracleOutput, tMSSQLOutput etc.,

anybody worked with t[DB]Row?.

I want like to know if anybody has worked on how to defer the hashing of lookups and lookup when input rows are passed into tMap or transformation?

Offline

#9 2008-04-18 01:06:40

Volker Brehm
Member
Registered: 2007-04-03
Posts: 1139
Website

Re: java tmap tOracleOutput, tMSSQLOutput etc.,

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

#10 2008-04-18 14:17:33

itc_man
Member
Registered: 2008-04-16
Posts: 11

Re: java tmap tOracleOutput, tMSSQLOutput etc.,

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

#11 2008-04-18 23:55:11

Volker Brehm
Member
Registered: 2007-04-03
Posts: 1139
Website

Re: java tmap tOracleOutput, tMSSQLOutput etc.,

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

#12 2008-04-19 05:56:32

itc_man
Member
Registered: 2008-04-16
Posts: 11

Re: java tmap tOracleOutput, tMSSQLOutput etc.,

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

#13 2008-04-22 18:37:59

itc_man
Member
Registered: 2008-04-16
Posts: 11

Re: java tmap tOracleOutput, tMSSQLOutput etc.,

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

#14 2008-05-02 03:55:32

SMaz
Member
Registered: 2008-04-21
Posts: 186
Website

Re: java tmap tOracleOutput, tMSSQLOutput etc.,

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

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » java tmap tOracleOutput, tMSSQLOutput etc.,

Board footer

Powered by FluxBB