hesco has asked for the wisdom of the Perl Monks concerning the following question:
My test script throws these errors:
originating from this method: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 . . .
What's up with that? Why would that update query not want two bind variables to execute?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; }
-- 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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBD::Pg ignoring placeholders, which are obvious to me at least . . .
by ikegami (Patriarch) on Aug 21, 2009 at 19:50 UTC |