Can I to skip errors and/or proceed execution of multi_query or I must to separate my big request and execute queries in query() individually? I execute such operators as CREATE VIEW, CREATE TABLE, CREATE PROCEDURE, etc. For example, I'm not very interesting, was TABLE created, or there was some FK constraint error, or VIEW has select from other schema which not exists, etc. I just want to show error output in STDERR and execute next operator after failed or successfully completed statement.
Asked
Active
Viewed 939 times
0
-
Please elaborate a little, what errors? – Prof Jan 11 '12 at 06:56
-
Errors usually mean something; what error do you want to skip? You mean database related errors? Do they allow you to go on? – Damien Pirsy Jan 11 '12 at 06:59
-
I execute such operators as CREATE VIEW, CREATE TABLE, CREATE PROCEDURE, etc. For example, I'm not very interesting, was TABLE created, or there was some FK constraint error, or VIEW has select from other schema which not exists, etc. I just want to execute next operator after failed or successfully completed statement. – Guy Fawkes Jan 11 '12 at 06:59
-
Yes, I now that errors have their meaning, but I want to just show user error output; I can stop in a case of syntax, not logical table/view/routines structure errors. – Guy Fawkes Jan 11 '12 at 07:01
-
That wasn't clear from your question :) – Damien Pirsy Jan 11 '12 at 07:03
-
Okay, I'll fix it now. Sorry. – Guy Fawkes Jan 11 '12 at 07:04
-
try '@' sign before mysql function ??? – Mohit Bumb Jan 11 '12 at 07:49
-
It will skip multi_query if it will raise error. It's not the behavior I want. And I use Mysql**i**, not Mysql. – Guy Fawkes Jan 11 '12 at 07:52
1 Answers
1
I assume you are talking about an error raised on a query when running multi queries stops the whole execution...
Add IGNORE
, for example
INSERT IGNORE into ...;
UPDATE IGNORE ...;
IGNORE
will prevent the raised error from stopping the multi-query process

Prof
- 2,898
- 1
- 21
- 38
-
In DDL operators there are no IGNORE keyword (or it exists, but for other purposes). – Guy Fawkes Jan 11 '12 at 07:05
-
See, might have been worthwhile mentioning DDL operators in your original question... ;) – Prof Jan 11 '12 at 07:06
-
@Guy Fawkes How? please share the fix. I am also facing the same problem. – ASHUTOSH Aug 18 '12 at 09:17
-
I mean I changed my question :) In my application I only give to user 2 options: debug mode with skipping of bad queries and fast mode without skipping. – Guy Fawkes Aug 20 '12 at 11:20