Knime DB Writer - Procedure for Sequential Writing

Hi there

I’m trying to write multiple tables (~20) into the same database; however it hangs when I try to run the workflow (just the knime DB Writer nodes). So I have to cancel the nodes and then I run the nodes individually.

I tried to create sections, by setting up three Write nodes to one MySQL Connector node to see if it would improve it but I still have the same issue. Is there a way I can sequentially write each of the tables to the database; i.e. only writing one table to the database after the current write is finished? I noticed there was a workflow called “02_Using_Flow_Variables_to_control_Execution_Order” which could possibly assist.

  • However I do not really understand how it works.

Please could you advise / assist on a possible solution. Thanks (PS. I am a little new to both knime and databases)
image

Hi @Sajith,

in KNIME the execution of a node starts once the previous node is executed. This is also true for nodes with flow variable connection (red connection lines).
This means if you have three nodes, which are not connected to each other, you can use flow variable connections to define the order of the execution. In the example below Node A is executed first, then Node B and lastly node C.


The flow variable ports (red circles on the upper left and right of a node) are normally hidden. To display them you can right click on a node and select “Show Flow Variable Ports”. Next you can connect them to define the order of the execution.

Best,
Kathrin

7 Likes

Thank you so much Kathrin, that worked brilliantly. Just checking, once I connect the flow variable ports like that (point to point) - I don’t see any reference to the flow port connection in the “configure” window, right?

The general idea of flow variables is to use them as workflow parameters to overwrite setting options. This section of the E-learning course gives you an introduction to flow variables and how you can use them in the configuration window.
https://www.knime.com/knime-introductory-course/chapter7/section1

Have in mind that sometimes those connectors need to initiate separate connections in order to work, i.e. each write operation to a separate connection. You could also line them consequentially to follow your process.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.