in reply to Re: DBI won't let go!
in thread DBI won't let go!

I think that dws and I have the same suspicions (I may be wrong). If you are going to the extent of doing a prepare then reuse it. Try :-
my $dbh = DBI->connect('Blah', 'Blah', 'Blah', 'Blah'); $dbh->{LongReadLen} = 65535; my $stmt = $dbh->prepare(" UPDATE Images SET Name = ?" ); for my $file (@JpgList){ my $rv; $rv = $stmt->execute or die $stmt->errstr; $stmt->execute($file); rename("$_","Processed/$_"); } $stmt->finish; $dbh->disconnect;
"execute"
$rv = $sth->execute or die $sth->errstr;
$rv = $sth->execute(@bind_values) or die $sth->errstr;

Perform whatever processing is necessary to execute the prepared statement. An "undef" is returned if an error occurs. A successful "execute" always returns true regardless of the number of rows affected, even if it's zero (see below). It is always important to check the return status of "execute" (and most other DBI methods) for errors.

For a non-"SELECT" statement, "execute" returns the number of rows affected, if known. If no rows were affected, then "execute" returns "0E0", which Perl will treat as 0 but will regard as true. Note that it is not an error for no rows to be affected by a statement. If the number of rows affected is not known, then "execute" returns -1.

PS do you really want to do an unconstrained update to the images table?

Hope it helps
UnderMine