 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
michalk
Joined: 29 Aug 2014 Posts: 211
|
|
[SQL Editor] How to disable 'continue on error' behaviour |
|
Recently I found, if executing SQL script throw error, SQL Editor skips it, and proceeds with next statements.
Example:
 |
 |
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
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 |
|
 |
michalk
Joined: 29 Aug 2014 Posts: 211
|
|
|
|
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 |
|
 |
|
|
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
|
|
|