The link just worked for me, but then again, CPAN has been a bit flaky lately.

That said, here is the wording from the relevant section:

do $rows = $dbh->do($statement) or die $dbh->errstr; $rows = $dbh->do($statement, \%attr) or die $dbh->errstr; $rows = $dbh->do($statement, \%attr, @bind_values) or die ... Prepare and execute a single statement. Returns the number of rows aff +ected or undef on error. A return value of -1 means the number of row +s is not known, not applicable, or not available. This method is typically most useful for non-SELECT statements that ei +ther cannot be prepared in advance (due to a limitation of the driver +) or do not need to be executed repeatedly. It should not be used for + SELECT statements because it does not return a statement handle (so +you can't fetch any data).
The key to using do is that it can only return the number of row affected by an operation. This makes it ideal for INSERT, UPDATE and DELETE, but it simply can't do what you want when it comes to a SELECT statement.

Sorry if the first post came across as a bit harsh, I should have put a smiley in there somewhere. Now that you beginning your endeavor to grok "DBI" you should probably a browser window open to the CPAN docs for it constantly. Hell, I still go back and check details on calls.

It helps to remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.

In reply to Re^3: Can not get the same output from $dbh->do and $dbh->prepare by boftx
in thread Can not get the same output from $dbh->do and $dbh->prepare by thanos1983

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.