From the DBI documentation:

When all the data has been fetched from a SELECT statement, the driver + should automatically call finish for you. So you should not normally + need to call it explicitly except when you know that you've not fetc +hed all the data from a statement handle. The most common example is +when you only want to fetch one row, but in that case the selectrow_* + methods may be better anyway. Adding calls to finish after each fetc +h loop is a common mistake, don't do it, it can mask genuine problems + like uncaught fetch errors.
And also says:
Calling finish resets the /Active attribute for the statement. It may +also make some statement handle attributes (such as NAME and TYPE) un +available if they have not already been accessed (and thus cached). The finish method does not affect the transaction status of the databa +se connection. It has nothing to do with transactions. It's mostly an + internal "housekeeping" method that is rarely needed. See also /disc +onnect and the /Active attribute.

Update: The DBI docs (same link) also says for the execute method:

If execute() is called on a statement handle that's still active ($sth +->{Active} is true) then it should effectively call finish() to tidy +up the previous execution results before starting this new execution.


In reply to Re: Re: DBI (Prepare once execute many fails) by Itatsumaki
in thread DBI (Prepare once execute many fails) by ColtsFoot

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.