CF by default escapes single quotes in variables in queries (to prevent
errors when inserting or updating strings with apostrophes :-)

#preservesinglequotes(wherestring)#

will prevent CF from escaping your single quotes.


--  Ben Doom
    Programmer & General Lackey
    Moonbow Software, Inc

: -----Original Message-----
: From: Sparrow-Hood, Walter [mailto:[EMAIL PROTECTED]
: Sent: Thursday, September 11, 2003 5:26 PM
: To: CF-Talk
: Subject: Misbehaving query
:
:
: I am trying dynamically build a query.
:
: I have the following string variable:
:       WhereString = "userID = 'foo' "
:
: When I do a normal cfoutput  #whereString#  I get userID = 'foo'
:
: So far, so good == but when I put it in a cfquery such as,
:
:       SELECT blah
:       FROM    yuk
:       WHERE #whereString#
:
: CF ends up passing  user="foo" in the SQL string and it obviously
: throws an
: error.
:
: Anybody know how to get around this??
:
: 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

Reply via email to