I had a cron set up that would insert into table A from table B and then truncate table B as follows:
set transaction read write;
insert into online_regs_hold_tst select * from online_regs_test;
truncate table online_regs_test;
I thought that by using the set transaction I was setting up an "all or nothing" senario - I'm wrong by the looks of things. I did a test and if the the insert fails it still truncates the table.
Is there a way to set this up so that you have - if the insert fails, the truncte fails ?