And of course I just realized that the error your seeing is in the
replace bit, so the other stuff was an error waiting to happen.

Are you trying to use the MySQL replace function or the CF replace function?

mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/



2009/4/5 James Holmes <james.hol...@gmail.com>:
> Strings need single quotes in SQL:
>
> WHERE Replace(d.DealerCode,'-','','all') = '#matchDealer#'
>
> However, you must use cfqueryparam for any user provided input:
>
> WHERE Replace(d.DealerCode,'-','','all') = <cfqueryparam
> cfsqltype="cf_sql_varchar" value="#matchDealer#">
>
> mxAjax / CFAjax docs and other useful articles:
> http://www.bifrost.com.au/blog/
>
>
>
> 2009/4/5 BobSharp <bobsh...@ntlworld.com>:
>>
>> Table has a Primary Key of  DealerCode  (UUID)
>> A form  POSTs   the required key ( form.txtDealer ) to be picked up by the 
>> Details Update page.
>>
>>
>> My scripting for the Update Details page  includes ...
>>    <CFoutput >#form.txtDealer#</CFoutput>
>>    <CFset matchDealer=Replace(#form.txtDealer#,'-','','all') />
>>    <br /> <CFoutput >#matchDealer#</CFoutput>
>>    <CFset vDealer= '' &  #matchDealer# & '' />
>> Outputs from that are correct.
>>
>>
>> This query fails ...
>> <CFquery name="qUpdate"  datasource="#appDSN#" >
>>    SELECT  *
>>    FROM  Dealers d
>>    WHERE Replace(d.DealerCode,'-','','all')=#matchDealer#;
>> </CFquery>
>>
>>
>> Errors are  ...
>>          Error Executing Database Query.
>> You have an error in your SQL syntax; check the manual that corresponds to 
>> your MySQL server version for the right syntax to use near 
>> ''all')=4A1BC12D6C1D460FB50D7420A5BA306B' at line 3
>>
>> The error occurred in /web/PurchaseOrders/update_Dealer.cfm: line 40
>> 38 :     SELECT  *
>> 39 :     FROM  Dealers d
>> 40 :     WHERE Replace(d.DealerCode,'-','','all')=#matchDealer#;
>> 41 : </CFquery>
>>
>> SQL        SELECT * FROM Dealers d WHERE 
>> Replace(d.DealerCode,'-','','all')=4A1BC12D6C1D460FB50D7420A5BA306B;
>>
>>
>> --
>> I am using the free version of SPAMfighter.
>> We are a community of 6 million users fighting spam.
>> SPAMfighter has removed 12892 of my spam emails to date.
>> Get the free SPAMfighter here: http://www.spamfighter.com/len
>>
>> The Professional version does not have this message
>>
>>
>> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321330
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to