Run DB Queries on multiple DBs

@masgo these things to consider:

  • are the databases of the same type (ORACLE, Postgres, …) or are they different databases
  • to just reproduce a code you can use a meta node or component so you would only have to edit (and store) the code once and you can re-use it in the other items. You might have to use Flow Variables to insert the table names
  • if you have different database types they might have slightly different SQL dialects. You can address that by using the ‘brown’ DB nodes of KNIME which should take care of that
  • you can combine the approaches (meta node/component) with a loop or switch. You will have to store the items that change (DB access, table name and so on) in some sort of meta table
  • if you plan for a loop it is easier to include new DB connections (If there could be much more)
  • do you want all the SQL code in one node or do you want to split the table selection and code (brown DB nodes) to easier maintain the setting

Maybe you start by setting up an example using SQLite and H2 as stand-Ins for your different databases and start setting up a working example that would represent your challenge

4 Likes