Select query with 'IN' operator implemention with tmap in talend open studio

Four Stars

Select query with 'IN' operator implemention with tmap in talend open studio

Hi,

I have query example

(SELECT column_name(s)
FROM table_name
WHERE column_name IN (value 1, value 2, ...);

 

How do i implement the above select statement with IN operator using 'tmap' in talend open studio.

Thanks in advance,

Rekha.

Six Stars

Re: Select query with 'IN' operator implemention with tmap in talend open studio

Hi ,

you can use tmap filter option with or clause to implement the in operator in talend

eg.

row2.colname ==10 || row2.colname== 20

Four Stars

Re: Select query with 'IN' operator implemention with tmap in talend open studio

Thank You Pankaj. I tried the solution, It works with value list.

If i want select value from another table. Is there any way to do this.

Ex: SELECT column_name(s)
FROM table_name
WHERE column_name IN (SELECT STATEMENT);

 

Thanks in advance.

Rekha

 

Nine Stars

Re: Select query with 'IN' operator implemention with tmap in talend open studio

In that case you would need lookup data flow into your tMap which would be the subquery part of your SELECT statement - and then join based on conditions in tMap.
Four Stars

Re: Select query with 'IN' operator implemention with tmap in talend open studio

Hi abhishek,

 

When you say "need lookup data flow into your tMap" 

Can you elaborate on this, How to perform this.

As i am new to Talend. Appreciate your help.

 

Thanks,

Rekha 

Six Stars

Re: Select query with 'IN' operator implemention with tmap in talend open studio

Hi ,

Whatever query you are using in the IN clause put it in another tDBInput component and join this to tables using tamp and then do the inner join on the column which you are using in the query WHERE Clause 


@RekhaB wrote:

Hi abhishek,

 

When you say "need lookup data flow into your tMap" 

Can you elaborate on this, How to perform this.

As i am new to Talend. Appreciate your help.

 

Thanks,

Rekha