Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Answer: What are placeholders in DBI, and why would I want to use them?

by zby (Vicar)
on Jul 16, 2003 at 10:32 UTC ( #274758=categorized answer: print w/replies, xml ) Need Help??

Q&A > database programming > What are placeholders in DBI, and why would I want to use them? - Answer contributed by zby

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.

  • Comment on Answer: What are placeholders in DBI, and why would I want to use them?
  • Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2016-10-01 04:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (574 votes). Check out past polls.