Re-execute db query if data are not complete

Hi guys,

I am trying to setup a workflow that pulls data from a database, checks if the data is complete and if not complete, waits for a specific time (e.g. 1h) and queries the database again. The data are uploaded into our database with certain delays, which are not constant. I have implemented this up to the ‘if switch’ that checks if data is complete or not. Is there a way to re-execute the ‘db query’ or ‘db reader’ again? Any hints or ideas are highly appreciated.

Thanks in advance, Denis

@d3n1s welcoem to the KNIME forum

I tried to ste up somthing similar a while back. Maybe you can check the discussion and the workflow collection. Also there is the KNIME server to automate things more comfortably.

2 Likes

Hi @d3n1s and welcome to the Community.

You probably want to use a loop in your case.

You can use the Generic Loop Start with a Variable Condition Loop End:

You start the loop, and then do the DB Query or DB Query reader inside the loop. Check if your data is complete, and set condition for the Loop end based on that check. If data is complete, loop ends. If data is not complete, loop again.

As always with this type of loop, you should have a fail-safe and add an additional condition, such as if loop has iterated 5 or 10 times, you have to throw an error, or it could go to infinite loop

3 Likes

Hi guys,

thanks a lot for your answers. I was thinking of using a loop indeed, just was not sure which exact node to use. This is definitely helpful.

Regards,
Denis

2 Likes

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