Dave,

I just ran this and it worked fine. I am on CFMX 7. What version are you
running? Did you try using CFQueryParam for the value?
 

......................
Ben Nadel
Certified Advanced ColdFusion MX7 Developer
www.bennadel.com
 
Need ColdFusion Help?
www.bennadel.com/ask-ben/

-----Original Message-----
From: Dave Phillips [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 19, 2007 12:50 PM
To: CF-Talk
Subject: Help with single quote in QofQ

Hi,
 
I have a query on which I'm doing a query of queries to find specific
values.  One of my values has a single quote in it.  When I dump the
query, I can see the value with the single quote.  But when I do a Q of
Q on it to find the specific record based on a string comparison, I get
zero results.
I've tried using preserveSingleQuotes() around the value, and even tried
replacing the value's single quote with two single quotes, but I can't
find the right combination to get it to work.  Either I get zero
results, or a ColdFusion "error executing database query" (query of
queries syntax error) which is actually kind of funny since it's not
really a database query anyway.  But that's beside the point.
 
Anyway, here is my sample code to show you what's happening.  If anyone
can figure this one out, I would greatly appreciate it.  I must be
"forgetting"
something simple!
 
<cfset qDave = queryNew("mystring")>
<cfset queryAddRow(qDave)>
<cfset querySetCell(qDave,"mystring","This is Dave's test.")> <cfset
sSearchString = "This is Dave's test."> <cfdump var="#qDave#"> <cfquery
dbtype="query" name="q">  SELECT *  FROM qDave  WHERE mystring =
'#sSearchString#'
</cfquery>
<cfdump var="#q#">
 
TIA!
 
Dave





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 & 
Flex 2. 
Free Trial 
http://www.adobe.com/products/coldfusion/flex2/

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:270117
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to