Are you *sure* PreservereSingleQuotes() doesn't work?
This works fine:
<cfset myQry = "select 'hello'">
<cfquery name="q" datasource="#request.dsn#">
        #PreserveSingleQuotes(myQry)#
</cfquery>
I'd guess you're over escaping them somewhere along the line...

Bert

On Thu, 3 Feb 2005 13:39:24 -0500, Burns, John D
<[EMAIL PROTECTED]> wrote:
> I'm going crazy here because I can't figure out why this is acting this
> way.
> 
> We've got some code in a CFSCRIPT block that builds some SQL to be
> executed in a query.  The variable holds a value that looks like this:
> 
> insert into table(id,value1,value2,value3) values(9,'First Name', 'Last
> Name','123-123-1234')
> 
> and when we dump the variable prior to the query, it looks fine and we
> can copy and paste it into Enterprise Manager or SQL Query Analyzer and
> it does what it's supposed to.
> 
> However, we try putting that variable into a <cfquery> tag and for some
> reason it doubles up all of the single quotes and then the query fails.
> We've tried putting 2 single quotes on each side of a string and also 3
> single quotes on each side.  It seems to double whatever number of
> single quotes we put there.  We've also tried PreserveSingleQuotes() and
> we've tried no quotes but nothing works.  I know I'm missing something
> simple.  Anyone have any ideas?
> 
> John Burns
> Certified Advanced ColdFusion MX Developer
> Wyle Laboratories, Inc. | Web Developer
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192950
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to