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


In reply to Re: Re: DBI won't let go! by UnderMine
in thread DBI won't let go! by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.