Using data from table column in SQL query

Good day to you all, Knime people. 

I just started to build my own workflow, and still a bit lost among nodes for data manipulation.

I have a table with one columns containing list of  ids and want to use it for the query in database reader, something like this: 

Select * from dbTable where idTable in (ListOfMyIds)

Could you advise on the best approach to to so?

So far I did it using the R node to generate the query string from table, and then couple of nodes to extract the string. 

(here is supposed to be a snapshot of the worflow, I see it in the edit tab,  but not in the view  o_o , so here is the link instead https://srv-file1.gofile.io/download/YrVcNh/knime-sqlquery.PNG)

It looks a bit bulky to me espacially If I want to use it several times. I guess I can design a "supernode" out of this but is there a better KNIME way?

Thanks for reading anyway :)

P.S. My aim is to design workflow that I can share with less experiencesd people, so that they also can modify it. So the more transparent is the way the better. 

 

 

 

 

Have a look at the Database Looping node under Database --> Read/Write. It does exactly what you are looking for.

Additional question - is there a node where I can store a single text variable, or should it always be a table?

Thanks a lot Marko, it looks good! 

Normally it would be a table, even if for a single string. KNIME takes care of making it memory efficient for you anyway.

Another option is to use Flow Variables, but it depends on your use case.

Do you know if it makes a separete query to the database for each value in the column?

For 3000 ids in a list it took a minute with Database looping when with Rnode solution its less than 10 seconds.

UPD. Found it - there is a "number of values per query" option, now it really works :)

Indeed. Glad you found it!