Now that's a good call. Good syntax as well. Thanks a ton. It defeats the purpose of the placeholders to call them every loop

My problem was my inability to realize i could make more than one statement handle, that makes everything easier, even though the man pages no doubt explicitly state that you can. Go go perlmonks.

Ok, now thanks for all the help, here is the finished product:

Note that i stayed with the bind_columns/fetch idea, which should be faster. I suppose, though, that a bind_col might speed it up even more...

$sth = $dbh->prepare(q{SELECT oid from items where orderid = ?}) || +die $dbh->errstr; $sth->execute($orderid) || die $dbh->errstr; $sth->bind_columns(\$oid); # Binds each column to $oid, through ref +erence my $sth_udt = $dbh->prepare(qq{UPDATE items set price = ? WHERE oid += ?}); while ($sth->fetch) { my $price = param("item_${oid}_price"); $sth_udt->execute($price, $oid); # You could probably just do this, but it didn't work for me...? +!?!: # $sth_udt->execute(param("item_${oid}_price"), $oid); }

In reply to RE: RE: RE: DBI Select and Update by nutate
in thread DBI Select and Update by nutate

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.