The single quote is an SQL delimiter and CF will escape it automatically. If what you're saying is that you try to update a field with a value "INT'L" and it gets inserted as "INT''L", then I would suspect that CF is somehow escaping your single quote when it shouldn't. If you can post the code for your update query, I or someone in the forums can tell you how to correct it. Depending on your syntax, the CF function preservesinglequotes() may be what you need.
It looks like you just need to use the preservesinglequotes() function as CF will esacpe single quotes in dynamic sql statements. If you're executing your query like this,
The only problem is that if any of your variables contain single quotes, you will have to manually escape them with the replace function like this.
<CFSET SQL = "UPDATE MasterOut SET MethodBy =""#replace(MethodBy_Value,"'","''","all"#"", ....>
Is there any reason why you're trying to build a dynamic sql statement instead of just doing the query with dynamic variables? If you can get by without having to put the whole query in a variable, it will make this a lot easier.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.