Confusion reigns here for the moment. My query asks for two bind variables and I give it two. What might this mean?
My test script throws these errors:
UPDATE asd_call_lists SET queued = \'t\' WHERE phone = ? AND userid =
+?;
DBD::Pg::st execute failed: called with 2 bind variables when 0 are ne
+eded at . . .
originating from this method:
sub _mark_as_called {
my $self = shift;
my $phone = shift;
my $update = $self->{'cfg'}->param('sql.note_dial_result');
print STDERR $update, "\n";
my $sth = $self->{'dbh'}->prepare($update);
$sth->execute($phone,$self->{'s'}->{'userid'});
return;
}
What's up with that? Why would that update query not want two bind variables to execute?
-- Hugh
UPDATE:
Thanks Ikegami. I rewrote that query as: 'UPDATE asd_call_lists SET queued = TRUE WHERE phone = ? AND userid = ?;' and the error is no more. Those slashes were to escape the single quotes around t, inside the single quoted query. Not sure why the escapes were not appropriately processed. Thanks again.
if( $lal && $lol ) { $life++; }
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.