OK,

I tried this:
<cfif len(form.description) gt 0>
and contains(description,'#Form.description#')
</cfif>

This is the sql statement it creates and the error:

Error Executing Database Query.  
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft 
Access Driver] Syntax error (missing operator) in query expression 'purchased = 
no and contains (description,'g')'.  
  
The error occurred in C:\CFusionMX7\wwwroot\cfdocs\donor_search_action.cfm: 
line 37
 
35 :                                    <cfif len(form.description) gt 0>
36 :                                    and contains 
(description,'#Form.description#')
37 :                                    </cfif>
38 :                                    
39 :                                    order by donor

 

--------------------------------------------------------------------------------
 
SQL    SELECT * FROM HamCom05 where purchased = no and contains 
(description,'g') order by donor 
 




>Bill,
>
>I used "contains" in a select statement, but it is in Oracle 10g and it
>is for searching BLOB field only, I believe. The syntax is:
>
>Select someField from myTable where contains (myBLOB, 'StringToFind') >
>0;
>
>To use "Contains" in Oracle BLOB field, you have to build index on it
>first.
>
>I am not aware if CF has the "Contains" syntax, but maybe I am not up to
>date with the new version of CF.
>
>
>Nathan Chen
>
>
>-----Original Message-----
>From: bill davis [mailto:[EMAIL PROTECTED] 
>Sent: Friday, May 18, 2007 9:55 AM
>To: CF-Newbie
>Subject: Query using "Contains"
>
>What is the correct CF syntax for a contains query.  I have no problem
>using the "like" statement, but I cannot get "contains" to work.  I am
>building a search to allow the user to enter a partial.
>
>Here is what I tried:
>
><cfif len(form.description) gt 0>
>and description contains (description,'%#Form.description#%')
></cfif>
>
>Error:
>
>Error Executing Database Query.  
>[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC
>Microsoft Access Driver] Syntax error (missing operator) in query
>expression 'purchased = no and description contains
>(description,'%g%')'.  
>  
>The error occurred in
>C:\CFusionMX7\wwwroot\cfdocs\donor_search_action.cfm: line 37
> 
>35 :                                   <cfif len(form.description) gt
>0>
>36 :                                   and description contains
>(description,'%#Form.description#%')
>37 :                                   </cfif>
>38 :                                   
>39 :                                   order by donor
>
> 
>
>------------------------------------------------------------------------
>--------
> 
>SQL    SELECT * FROM HamCom05 where purchased = no and description
>contains (description,'%g%') order by donor 
> 
>
>Thanks,
>Bill

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

Archive: 
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:2752
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to