<cfqueryparam>  may just help.

I believe it will do any escaping as need.


<cfquery>
update table
set text = <cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#text#">
</cfquery>


-----Original Message-----
From: Fabio Serra [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 26, 2001 11:23 AM
To: CF-Linux
Subject: ColdFusion or unixOdbc ?


Who is responsible to escape special chars in a query?
ColdFusion with <cfquery> or the odbc driver?
I have a problem with the newer driver for PostGresSQL (unixodbc ) and the 
newer PostGresSQL version (7.1.3). All is running with CF 5 on a supported 
Linux Distro (Suse 7.2).
If I made an insert or update query  an error occured if there is a 
backslash and a quote (  \' ) combination

<cfset text = "  \'  "
<cfquery>
update table
set text = '#text#'
</cfquery>

Error while executing the query (non-fatal); ERROR: Unterminated quoted
string

The same thing doesn't happen with other database.
AFAIK in ColdFusion there isn't any function like the PHP addslashes($text);
Bye.
--------------------------------------------------
FABIO SERRA - faser(at)faser.net
PGP available
--------------------------------------------------


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-linux%40houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_linux or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to