This is a discussion on Can you do this in MySQL 4.1 scripting? within the MySQL Database forums, part of the Database Forums category; Is it possible to catch an error in 4.1 scripting? I have found that whan I run a script ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Is it possible to catch an error in 4.1 scripting? I have found that whan I
run a script and a line of the script cannot find a table - instead of halting the script continues to run. Is there anyway to get MySQL to halt the running of a script if an error occurs in one line? It's a little like the whole system is running with the VB 'on error resume next' running all of the time. Thank you for your help. |
|
|||
|
> Is it possible to catch an error in 4.1 scripting? I have found that whan I
> run a script and a line of the script cannot find a table - instead of > halting > the script continues to run. Funny question. MySQL does not support multiple queries, so the only one that is aborted is all there is to abort. If you keep sending it queries without checking for errors, you specifically _ask_ it to ignore the errors. The aborted query is aborted as a whole. Every query is an all-or-nothing command. If you mean running a file in the mysql command-line client, it should not continue unless you specify the --force option. Best regards -- Willem Bogaerts Application smith Kratz B.V. http://www.kratz.nl/ |
|
|||
|
"Willem Bogaerts" <w.bogaerts@kratz.maardanzonderditstuk.nl> wrote in
message news:45b76d23$0$328$e4fe514c@news.xs4all.nl... >> Is it possible to catch an error in 4.1 scripting? I have found that whan >> I >> run a script and a line of the script cannot find a table - instead of >> halting >> the script continues to run. > > Funny question. MySQL does not support multiple queries, so the only one Not really. If I have a multiple list of commands in a script and one of those lines errors (perhaps the table doesn't exist etc.) then I would expect the whole script to stop running. It doesn't do this - it carries on regardless. Sort of basic expectation of what a set of code should do really. --- Sam |