From: Daevid Vincent Date: May 25 2006 2:09am Subject: RE: How do I turn off error checking List-Archive: http://lists.mysql.com/mysql/198291 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable As mentioned in the original email, I know about forcing it, but I can't = do that in my case. D=C6VID =20 > -----Original Message----- > From: sheeri kritzer [mailto:awfief@stripped]=20 > Sent: Wednesday, May 24, 2006 6:27 PM > To: Daevid Vincent > Cc: mysql@stripped > Subject: Re: How do I turn off error checking >=20 > If you run a script with >=20 > mysql < script.sql >=20 > then if there's an error, the script dies. >=20 > If you run a script with >=20 > mysql -e "source script.sql" >=20 > Then the script will just spit out an error and move on to=20 > the next command. >=20 > Hopefully that will help. >=20 > -Sheeri >=20 > On 5/24/06, Daevid Vincent wrote: > > Semi related to this, as it appears in my searching that this is > > unfortunately not a supported feature. Is there a flag or=20 > something that I > > can put in my .sql file that will turn OFF any error=20 > checking, execute my > > statements (so that even if one fails, the next one will be=20 > tried), then > > turn it back on again at the end of the file? Sort of like=20 > how you can do > > the "SET FOREIGN_KEY_CHECKS=3D0;" so something akin to "SET=20 > ERROR_CHECKS=3D0;" > > or "SET FORCE=3D1;" > > > > And, yes, I do know that there is a --force option for the=20 > importing, but I > > cannot use that in my case. This is an automated script and=20 > generally I want > > the SQL to fail on any errors b/c then I know the upgrade=20 > is hosed. This is > > a special case where some people got a SQL upgrade (by=20 > hand) and some > > didn't, hence the discrepency between the schemas. > > > > D=C6VID > > > > > -----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`; > > > > > > > > > =D0=C65=CF=D0 > > > > > > > > > -- > > > MySQL General Mailing List > > > For list archives: http://lists.mysql.com/mysql > > > To unsubscribe: > > > http://lists.mysql.com/mysql?unsub=3Ddaevid@stripped > > > > > > > > > > > > -- > > MySQL General Mailing List > > For list archives: http://lists.mysql.com/mysql > > To unsubscribe: =20 > http://lists.mysql.com/mysql?unsub=3Dawfief@stripped > > > > >=20 > --=20 > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: =20 > http://lists.mysql.com/mysql?unsub=3Ddaevid@stripped >=20 >=20