Solved

Perl MySQL DBI Insert with Quotes

Posted on 2007-11-15
1
2,557 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

863 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now