Matt,

I use LIKE all the time in MS SQL with CFQueryParam...just to make
sure my head is screwed on straight, I just ran the following against
an nvarchar column:

<cfquery datasource="alex" name="foo">
        where SomeColumn like <cfqueryparam cfsqltype="cf_sql_varchar"
value="%#SomeValue#%">
</cfquery>

-joe


On Mon, 31 Jan 2005 11:17:27 -0800, Matt Robertson
<[EMAIL PROTECTED]> wrote:
> > Why can't you use cfqueryparam?
> 
> I have actually experienced this myself with the following, and only
> on MS SQL Server.  The same statement works great in mySQL, Access and
> Oracle.  In the code below, if we are running SQL Server
> (localgrid.usedb=2) execution branches to bypass cfqueryparam.
> 
> I've seen the same problem with MS Access date fields.  I have yet to
> see a cfsqltype that will work with one of those, and working the
> problem from the other end have been unable to figure out a config
> within access itself that will work with one of the cfsqltypes.
> 
> <cfif Compare(LocalGrid.UseDB,"2")>
>         #TempGrid.QueryFieldName# LIKE
>         <cfqueryparam
>                 cfsqltype="#TempGrid.SType#"
>                 value="%#Evaluate(TempGrid.SearchText)#%">
> <cfelse>
>         <!---
>         sql server doesn't like cfqueryparam and fuzzy LIKE, so ...
>         --->
>         #TempGrid.QueryFieldName# LIKE '%#Evaluate(TempGrid.SearchText)#%'
> </cfif>
> 
> --
> --mattRobertson--
> Janitor, MSB Web Systems
> mysecretbase.com
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192399
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to