--- db/prgsrc/deletefiles.pl 2001/07/28 17:23:02 1.2 +++ db/prgsrc/deletefiles.pl 2001/07/28 21:19:06 1.3 @@ -28,7 +28,7 @@ createindex.pl(1), updatedb.pl(1), updat Boris Veytsman -=head1 $Id: deletefiles.pl,v 1.2 2001/07/28 17:23:02 boris Exp $ +=head1 $Id: deletefiles.pl,v 1.3 2001/07/28 21:19:06 boris Exp $ =cut @@ -46,8 +46,12 @@ MAIN: select Id,ParentId,QuestionsNum from Tournaments where Type='þ' and FileName='$file'"); $sth->execute; + if (!$sth->rows) { + print STDERR "File $file is not found in the database\n"; + next; + } while (my ($Id,$ParentId,$QuestionsNum) = $sth->fetchrow) { - print "Deleting $file Id=$Id, $QuestionsNum questions\n"; + print STDERR "Deleting $file, Id=$Id, $QuestionsNum questions\n"; UpdateParents($dbh,$ParentId,$QuestionsNum); UpdateChildrenAndDie($dbh,$Id); }