Solved

Perl MySQL DBI Insert with Quotes

Posted on 2007-11-15
1
2,558 Views
Last Modified: 2013-12-25
I have a dbh->do(qq"INSERT .... |); statement, but it will error if a $string has quotes in it - is there any easy way around this?

I'm aware of dbh-quote but then all the output is encased in quotes?
0
Comment
Question by:logicjb
1 Comment
 
LVL 48

Accepted Solution

by:
hernst42 earned 500 total points
ID: 20293174
replace all ' with \' in the text you want to insert/use in your SQL. Better use bindings for variable in this case.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
selecting date modified field from a table 2 44
React or Angular? 6 71
Export Variables in Perl 3 67
Excel - SQL export question 3 41
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

805 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question