We have run across this problem also. We just didn't use cfqueryparam for that field. What are you using for your database? We are using SQL server.
Kevin Kazmierczak. ----- Original Message ----- From: "Brad Howerter" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Thursday, February 20, 2003 10:03 AM Subject: unexpeted result with cfqueryparam > I don't see that behavior. This code works fine for me: > > <cfset variables.showLabel = "abc's"> > <cfquery datasource=#request.ser.udsn#> > UPDATE foo > SET showLabel = <cfqueryparam cfsqltype="cf_sql_varchar" > value="#trim(showLabel)#" /> > </cfquery> > > >Using cfqueryparm to update table with values coming from a standard form > >via a CFC, using the cfargumentcollection="#form#" > > > >In the form, I use HTMLEditFormat for fields where could be an apostrophe, > >etc. so sql insert or update goes ok. This has always worked as expected > >with simply inserting/updating table by field = '#field#' or using > >cfqueryparm: > >showTitle = <cfqueryparam cfsqltype="cf_sql_varchar" value="#showTitle#" />, > > > >Decided to add a trim to the field in the update, as in: > >showLabel = <cfqueryparam cfsqltype="cf_sql_varchar" > >value="#trim(showLabel)#" />, > > > >No errors or anything, but if there is an apostrophe in the field value, it > >inserts an additional apostrophe, so ' becomes ''. If update again, the '' > >becomes '''. > > > >If I take off the trim function in the cfqueryparm value, the apostrophe > >inserts/updates properly. > > > >I want to use the cfqueryparm, so just chucked the trim function. Just seems > >strange that trim would make this difference. I'd assume there's an > >explanation? > > > >Here are key parts of code: > > > >The input form: > ><input type="text" name="showTitle" > >value="#HTMLEditFormat(stShowSetUp.showTitle)#" size="60" maxlength="150"> > > > >Processing template: > ><cfinvoke component="galleryCfc" method="updateShow" > >argumentcollection="#form#" returnvariable="Updated"> > > <cfinvokeargument name="DS" value="#request.datasource#" /> > > <cfinvokeargument name="showID" value="#existShowID#" /> > ></cfinvoke> > > > >In the CFC: (query) > >Set showTitle = <cfqueryparam cfsqltype="cf_sql_varchar" value="#showTitle#" > >/>, etc updates > > > >Thanks for any insight! > > > >E. Keith Dodd > >Wings of Eagles Services > >[EMAIL PROTECTED] > > > > > >- > >[This E-mail scanned for viruses by declude AntiVirus Software] > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4