Loops over database tables


I am trying to build a sequence of joins over a set of tables that share a common structure. I would like to iterate over the table names, and have the end of the loop be a joiner, so that columns rather than rows are appended to the final data.

Has anybody tried to do so, and if so how?




Did something like that. First Iterated List of Files, then resulting table (which is appended by rows) was partially pivoted (Pivoting) and partially grouped (GroupBy) and then joined (Joiner).

How far this is suitable for you, depends on your data structure.

More global method might be after reading each file to Transpose it before passing to loop end node, then in resultant table hack the rowIDs according to your needs and Transpose it again.




This post may be of help:


Apologies - I should have made my question more specific. I am looking to iterate over database tables. So I want KNIME to produce different query strings where the table name is taken from a variable.



Hi Marco,

This is an example where one would use the loop support in KNIME. The trick is to create a list of tables (e.g. Create Table node or from an external source), inject them into a loop with the TableRow To Variable Loop Start and the append/join the column at the end of each loop iteration with the Loop End (Column Append). I have attached an example workflow that shows how it works.

Hope this helps,