in reply to Re: DBI won't let go!
in thread DBI won't let go!
"execute"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;
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
|
|---|