in reply to Re: Updating a database
in thread Updating a database

As grep. Also, if you don't use placeholders then there's no need to assign the query to a var before doing it. And the DBI error string would be interesting if it dies. If I wasn't going to use place holders I'd do
$dbh->do("update Volunteer set volunteer_id = $new_id and Number = $ne +wnumber where id = 2") or die $dbh->errstr;
... except for grep's reason I *would* use placeholders, so I'd use a slight tweak on dws:
my $sth = $dbh->prepare("UPDATE Volunteer " . "SET Volunteer = ? " . "WHERE Date = ? AND Volunteer = 'TBD' AND Number = ?" ) or die $dbh->errstr; my $rv = $sth->execute($status, $date, $id) or die $dbh->errstr;


§ George Sherston