SQL Script: Stop Execution on First Error

When running a MySQL script within DG, it continues to execute after errors are reported. How can I get it to stop execution after the first error is encountered?

 

I am running DG 1.0.2 on Windows 7.

4 comments
Comment actions Permalink

Hello Michael,

There is File | Settings | Database | General -> Execute in Console settings exist, where you can choose execution policy when running the script. Also if there is a error executing the script there should be a error toolbar, where you can choose the action to Retry Ignore or Stop execution:

Doesn't it work for you?

0
Comment actions Permalink

Nope, no luck there. Here is what I see in that settings pane:

There is nothing in there pertaining to stopping on error. As you can see in this screenshot:

I put in a deliberate error, and it did flag it in the editor pane, but it kept on going and executed the rest of the script. Also, I do not get that red panel like you show in your screenshot.

Hope this helps show what I get.

 

 

0
Comment actions Permalink

Thank you for the screenshot. Looks like you are executing the script via Run <Script Name> action, which indeed executes the whole script as a batch. Please try using Ctrl(Cmd)Enter and select the script part to execute. If you want to execute the whole script you could select all and execute selection or adjust the options in File | Settings | Database | General.

0
Comment actions Permalink

That did the trick, many thanks! I changed the settings like you suggested, and now use Ctrl-Enter instead of Shift-Ctrl-Enter. The execution now stops on the error and gives me the option to continue or not.

Again, many, many thanks! :)

0

Please sign in to leave a comment.