SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
[SQL Editor] How to disable 'continue on error' behaviour

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
[SQL Editor] How to disable 'continue on error' behaviour
Author Message
michalk



Joined: 29 Aug 2014
Posts: 211

Post [SQL Editor] How to disable 'continue on error' behaviour Reply with quote
Recently I found, if executing SQL script throw error, SQL Editor skips it, and proceeds with next statements.

Example:

Code:
CREATE TEMPORARY TABLE IF NOT EXISTS test (
   id SERIAL,
   val VARCHAR
);

 INSERT INTO test (val) VALUES ('a');

 INSERT INTO test (val) VALUES ('b');('c');

SELECT * FROM test;


Please note syntax error between inserting 'b' and 'c';
You can run this script multiple times, adding values to test table, doesn't matter that execution error ocurred.

In some cases it might have very negative impacts IMO (and it happened already, fortunately in devel environment)

Is there an option to disable skipping errors?
I know I can use BEGIN/COMMIT block to achive that, but it's not convenient, since our applications don't require such construct
I would imagine some switch/checkbox to enable/disable such behaviour, but in my opinion, current behaviour should be optional rather than default (comparing even to other applications)

with regards
Thu Nov 05, 2015 2:10 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7841

Post Reply with quote
In the simple "execute" mode there is no option to stop after an error. This is the default behavior for all db types.

However, you can use "Execute Code (Multi-Server)" command, Ctrl+Alt+F9 shortcut, to run your script and stop after an error. You can run it on a single server as well. When you use it, an Execute SQL Script on Multiple Servers dialog will appear. In that dialog, click All Connections in the top-right-corner, and check that Stop Execution on Error option is set to Yes, which is the default behavior.
Sat Nov 07, 2015 1:42 am View user's profile Send private message
michalk



Joined: 29 Aug 2014
Posts: 211

Post Reply with quote
Thanx for the answer.
Unfortunately, because I found this behaviour dangerous, it's pulling me back from working with the editor.

Please consider adding an option to enable stop-on-error for regular execute query.

with regards
Mon Nov 09, 2015 5:58 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.