List:General Discussion« Previous MessageNext Message »
From:sheeri kritzer Date:May 25 2006 4:12pm
Subject:Re: How do I turn off error checking
View as plain text  
Why not?  You can run a script that has 1 command, to source another
SQL file, and then your script will not die because of errors.  What
else is going on under the scenes here, to make it so you "can't" do
it?

source'ing the script is NOT forcing.  When you use mysql < file.sql,
if there's an error the process stops.  When you use source file.sql
on the mysql commandline, an individual error does not stop the rest
of the commands in the sql file from running.

-Sheeri

On 5/24/06, Daevid Vincent <daevid@stripped> wrote:
> As mentioned in the original email, I know about forcing it, but I can't do
> that in my case.
>
> DÆVID
>
> > -----Original Message-----
> > From: sheeri kritzer [mailto:awfief@stripped]
> > Sent: Wednesday, May 24, 2006 6:27 PM
> > To: Daevid Vincent
> > Cc: mysql@stripped
> > Subject: Re: How do I turn off error checking
> >
> > If you run a script with
> >
> > mysql < script.sql
> >
> > then if there's an error, the script dies.
> >
> > If you run a script with
> >
> > mysql -e "source script.sql"
> >
> > Then the script will just spit out an error and move on to
> > the next command.
> >
> > Hopefully that will help.
> >
> > -Sheeri
> >
> > On 5/24/06, Daevid Vincent <daevid@stripped> wrote:
> > > Semi related to this, as it appears in my searching that this is
> > > unfortunately not a supported feature. Is there a flag or
> > something that I
> > > can put in my .sql file that will turn OFF any error
> > checking, execute my
> > > statements (so that even if one fails, the next one will be
> > tried), then
> > > turn it back on again at the end of the file? Sort of like
> > how you can do
> > > the "SET FOREIGN_KEY_CHECKS=0;" so something akin to "SET
> > ERROR_CHECKS=0;"
> > > or "SET FORCE=1;"
> > >
> > > And, yes, I do know that there is a --force option for the
> > importing, but I
> > > cannot use that in my case. This is an automated script and
> > generally I want
> > > the SQL to fail on any errors b/c then I know the upgrade
> > is hosed. This is
> > > a special case where some people got a SQL upgrade (by
> > hand) and some
> > > didn't, hence the discrepency between the schemas.
> > >
> > > DÆVID
> > >
> > > > -----Original Message-----
> > > > From: Daevid Vincent [mailto:daevid@stripped]
> > > > Sent: Wednesday, May 24, 2006 12:13 PM
> > > > To: mysql@stripped
> > > > Subject: How do I add a column only if it doesn't exist?
> > > >
> > > > I want to do something like this:
> > > >
> > > > if not exists `hotel_page_templates`.`hpt_custom_fields`
> > > > alter table `hotel_page_templates` add column
> > > > `hpt_custom_fields` text after
> > > > `hpt_alternate_username`;
> > > >
> > > >
> > > > ÐÆ5ÏÐ
> > > >
> > > >
> > > > --
> > > > MySQL General Mailing List
> > > > For list archives: http://lists.mysql.com/mysql
> > > > To unsubscribe:
> > > > http://lists.mysql.com/mysql?unsub=1
> > > >
> > > >
> > >
> > >
> > > --
> > > MySQL General Mailing List
> > > For list archives: http://lists.mysql.com/mysql
> > > To unsubscribe:
> > http://lists.mysql.com/mysql?unsub=1
> > >
> > >
> >
> > --
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe:
> > http://lists.mysql.com/mysql?unsub=1
> >
> >
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
>
>
Thread
How do I turn off error checkingDaevid Vincent25 May
Re: How do I turn off error checkingsheeri kritzer25 May
  • RE: How do I turn off error checkingDaevid Vincent25 May
Re: How do I turn off error checkingsheeri kritzer25 May