Solved

Perl MySQL DBI Insert with Quotes

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
The viewer will learn how to count occurrences of each item in an array.

746 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

16 Experts available now in Live!

Get 1:1 Help Now