Sometimes you get an error in a query with placeholders, but the same query with values pasted in the placeholders works. In this case you might need to use bind_params with the third parameter - type. Like this:  $sth->bind_param(1, $value, 4) for integer values on my DBI.

I encountered this problem on a DB2 database accessed via ODBC, it seems that DBI quoted integer parameters and the database did not like it.


In reply to Re: What are placeholders in DBI, and why would I want to use them? by zby
in thread What are placeholders in DBI, and why would I want to use them? by btrott

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":