SQL SyntaxError Exception

HI , How to catch SQL SyntaxError Exception in workflow.

Hi @amar.khavare,

you can use the try catch nodes to catch errors from any node between the nodes :slight_smile:

Hello @amar.khavare,

Catch Errors (DB Ports) should be the one for DB operations?



@ipazin - sure you are correct, if @amar.khavare wants to catch solely db exceptions then the db ports would be better :thinking:
…I mostly use the variable catches to group whole processing steps in try/catches :slight_smile:

1 Like

I made DB Down while executing. I want the Loop to be ended
which node can be used for this ?

I tried using Try Catch Data Ports

Two things come to mind. I think this article might describe a useful idea.

Configure a loop to perform a certain number of retries when connecting to a database, waiting in-between the tried and then ending the loop.

If it comes to more general DB problems or failing SQL syntax I have recently set up this example. It deals with a missing table but might be adapted to more general failures.


Thanks for your reply

The workflow shared in first link is working perfect with DB SQL Executor & suffices my requirement. But I want to execute a select query. If I replace DB SQL Executor with DB Table Selector & DB Reader, then loop end is giving error

ERROR Variable Condition Loop End 2:133 Loop Body wired incorrectly (2:133 is not connected to a LoopStartNode but 2:138).

Hi @amar.khavare,
did you checked if the workflow success when you use the node ‘Table Row To Variable Loop Start’ instead ‘Generic Loop Start’ (Node 121)?


Replaced Generic Loop Start With ‘Table Row To Variable Loop Start’
Still the same
Catch DB Error.knwf (66.9 KB)

And if you connect your Generic Loop Start with your Java snippet node (134) using a cross joiner node and connect the cross joiner node to your Variable Conditions Loop End Node?

It is working fine if I am placing DB Reader outside that generic loop

This solves my purpose for now
Thanks a ton :slight_smile:

1 Like

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