You can't with MyISAM and executing from shell prompt.
Either alter the table type to BDB or Innobase
If you stick with MyISAM you can use a higher level language (perl,php) to check the
return value of each insert and handle the flow accordingly. If the 2nd insert fails,
you'll have to complement the first insert with a delete.
regards,
thalis
On Thu, 12 Apr 2001, Jochen Mielke wrote:
>
>
> Hello,
> Let's say I have a file which contains the following lines:
>
> insert into table_1 values (1,2,3);
> insert into table_2 values (4,5,6);
>
> It's called from the command line with mysql -u root -p<password> db_name <
> file;
>
> I would like to undo the first operation on table_1 in case the second query (on
> table_2) returns an error.
> I believe this could be done by using commit/rollback if I used BDB tables. But
> I'm using MyISAM.
> Any hints how could I make this?
>
> Thanks,
> Jochen
>
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
> http://www.mysql.com/manual.php (the manual)
> http://lists.mysql.com/ (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php