Steve, you kind of missed the point.. I was explaining how CF would convert a parameter into a query and the method you can use to simulate such activity outside CF. I really wouldn't recommend using this code in a cfquery tag.
 
Never heard of % signs being escaped, and we've used this method for ages? It does seem to work like it should, regardless of whether the signs really are being escaped or not.
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED]On Behalf Of Steve Onnis
Sent: Wednesday, 19 April 2006 2:31 PM
To: [email protected]
Subject: [cfaussie] Re: SQL search in CFMX 7

cant use cfqueryparam for LIKE clauses cause the % will just get escaped out so it will end up looking like
 
'%%word%%'
 
here is a work around
 
DECLARE @varName varchar(100);
SET @varName = <cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#Arguments.Value#" maxlength="100">;

SELECT ...
WHERE column LIKE '%' + @varName + '%'
 
Steve


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cfaussie" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cfaussie
-~----------~----~----~----~------~----~------~--~---

Reply via email to