0

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.

Guy Fawkes
  • 2,313
  • 2
  • 22
  • 39
  • 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 Answers1

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