• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Comparing a value from input delimited file with a value from a MySQL

#1 2009-08-17 16:28:55

Furnica
Member
Registered: 2009-08-17
Posts: 38

Comparing a value from input delimited file with a value from a MySQL

Tags: [compare]

Hello,

I am at my first contact with Talend and under pressure too, please give me a hand.

I need to read a value (SEQFIC) from an one-row input delimited file downloaded from FTP (done this) and compare the value from a field retrieved from a MySQL table (MRRD_Sequence_File).

If the MySQL table has no rows, or SEQFIC == MRRD_Sequence_File + 1, then continue the job; else die.

I thought to do the comparison in a tMap, but I do not know how to build comparison expressions, how do I test the number of rows in the table, and how do I test  SEQFIC_A == MRRD_Sequence_File + 1?

I attach the screenshot showing what I tried until now, but that doesn't work and I'm stuck.

Please give me a hint how to do this, I can not find something similar nor in the Talend documentation, neither among the tutorials on the Talend site.


Thank you very much.


Uploaded Images

Last edited by Furnica (2009-08-17 16:29:55)

Offline

#2 2009-08-18 05:49:44

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

Re: Comparing a value from input delimited file with a value from a MySQL

Hello
Add the filter condition on the output table, please see my screenshot

Best regards

          shong


Uploaded Images


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

#3 2009-08-18 10:14:42

Furnica
Member
Registered: 2009-08-17
Posts: 38

Re: Comparing a value from input delimited file with a value from a MySQL

shong wrote:

Hello
Add the filter condition on the output table, please see my screenshot

Best regards

          shong

Thank you Shong,


Your answer allows me to test half of the given condition.

Yet I can not test the other half, i.e. "if the MySQL table has no rows" - how can I check the number of rows in a table, or the number of rows returned by a Select?


Thank you very much for your time and for the help you provide.

Offline

#4 2009-08-18 13:32:04

emaxt6
Member
Registered: 2008-08-04
Posts: 325

Re: Comparing a value from input delimited file with a value from a MySQL

If you mean no rows during the lookup, just use the "inner join" flag in the tmap when joining.
else ifyou mean to react only if the source table has some rows, use tWaitForSqlData

bye

Last edited by emaxt6 (2009-08-18 13:32:29)

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Comparing a value from input delimited file with a value from a MySQL

Board footer

Powered by FluxBB