Filter rows from file with values from database (With tFilterRow and tJDBCRow)

Highlighted
Four Stars

Filter rows from file with values from database (With tFilterRow and tJDBCRow)

Hello!

 

I have a small problem using tFilterRow component in TOS Data Integration (version 6.5.1.).

I have two files that output into a database table. I need to filter the second filed based on values from the first file. My job currently looks like this (non-essential parts ommited)

RemoteDesktopManagerFree_2018-08-08_10-27-21.png

 

My thinking is: Filter the first file base on set values in the file (this works fine).

Then filter the second file based on the output values of the first file (that has already been filtered). The tJDBCRow component has a SQL-query "select distinct id from table" that should be used as the filter for the second file.

 

Any help would be greatly appreciated! Smiley Happy

 

BR. Smam

Highlighted
Six Stars

Re: Filter rows from file with values from database (With tFilterRow and tJDBCRow)

Hi ,

You can use following solution

tDBInput ------->tFlowToIterate ---> tFileInputDelimeted -----> tFilterRow ----->tfileOutputDelemited

In tFilterRow use condition as id Equals ((Integer)globalMap.get("row2.id")) 

and tFileOutputDelimeted in append mode 

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog