+ if (!($sqlhashref2 = $sth2->fetchrow_hashref)) {
+ #print "$name\n";
+ # set scheduling_priority to NULL
+ #print "UPDATE $table_name SET scheduling_priority=NULL WHERE individual=$individual\n";
+ $sth3 = $dbh->prepare("UPDATE $table_name SET scheduling_priority=NULL WHERE individual=$individual");
+ $sth3->execute or die "-E- DB error: $DBI::errstr\n";
+
+ # remove entry from tc_scheduling_priority
+ #print "DELETE FROM tc_scheduling_priority WHERE scheduling_priority=$scheduling_priority\n";
+ $sth3 = $dbh->prepare("DELETE FROM tc_scheduling_priority WHERE scheduling_priority=$scheduling_priority");
+ $sth3->execute or die "-E- DB error: $DBI::errstr\n";
+ $sth3->finish();
+ }
+ $sth2->finish();