How can I correctly quote query parameters using DBI?

Posted by imerez on Stack Overflow See other posts from Stack Overflow or by imerez
Published on 2010-04-15T10:25:32Z Indexed on 2010/04/15 10:43 UTC
Read the original article Hit count: 249

Filed under:
|
|

I am dumping the a number of things including the following into a db INSERT statement

\"$rec->{reqHdrs}\"

However when for example my value for reqHdrs contains quotes it causes the statement to end and thus cause invalid sql.

e.g.

bla;bla="http://www.yahoo.com/xhtml",bla bla

How do I escape the double quotes inside this statement ?

© Stack Overflow or respective owner

Related posts about perl

Related posts about escaped-characters