I have some code that executes an Insert to a database using DBI. When this exectue fails, I would like it to die gracefuly reversing the inserts that have taken place. Unfortunately, it dies a miserable death and takes IIS with it!
Has anybody else come across anything like this?
Has anybody else come across anything like this?
Code:
...
$sqlstatement= qq{
insert into items (parentid,title,description,archivedate,archiveid,imagename,status,indexed) values ($parentid,'$fields[2]','$fields[4]','$fields[3]',$archiveid,'$image',0,0)
$sth = $db->prepare("$sqlstatement");
$sth->execute or die "Wedi methu ar llinell $. , Wedi dad wneud yr ychwanegiadau\n";
...