Ask a Question related to Coldfusion Database Access, Design and Development.
-
Lion_b1 #1
No escape character with dircect method call in cfquery
Hello,
I found the follwing behavior when I tried to use a method call directly in a
<cfquery>.
In this case single quote characers will not be escaped.
Is it a bug or a feature?
Example:
#variables.login_name# => O'Hara
Problems (no escape of ' ) with:
(SQL Syntax error or access violation: You have an error in your SQL syntax
near ....)
<cfquery datasource="test" name="ins">
INSERT INTO at02_admin
( login_name )
VALUES
( '#StringReturn.teststring(variables.login_name)#' )
</cfquery>
O.K with
<cfquery datasource="test" name="ins">
INSERT INTO at02_admin
( login_name )
VALUES
( '#variables.login_name#' )
</cfquery>
The comonent is defined (for testing only) like
<cfcomponent displayname="StringReturn">
<cffunction name="teststring">
<cfargument name="sString" type="string" required="true" >
<cfset var sTest = ARGUMENTS.sString />
<cfreturn sTest >
</cffunction>
</cfcomponent>
Please let me know if someone is having similar problems.
Thanks.
Bernhard
Lion_b1 Guest
-
#37262 [Asn->Csd]: var_export() does not escape \0 character
ID: 37262 Updated by: iliaa@php.net Reported By: idiom at mail dot ru -Status: Assigned +Status: ... -
Escape character in SQL - how do I ignore ?
I have laboured through the joys of importing a CSV file and sticking the values in a MySQL database. So far so good. However the CSV file contains... -
Escape character when setting variable
I'm unsure on how to escape a character when setting a session variable. Here's my problem, I'm getting an outside variable that contains a dash in... -
[PHP] explode and escape character for string separator
One set of delimiters I often use for text files is ~~ or ^^. They are fairly unique. If they do appear in a file then there is probably garbage in... -
explode and escape character for string separator
--- "Reuben D. Budiardja" <reubendb@innovativethought.com> wrote: You should strive to make your delimiter unique. A delimiter that might... -
eastinq #2
Re: No escape character with dircect method call incfquery
Have you tried using the PreserveSingleQuotes() function in your Insert statement?
eastinq Guest
-
paross1 #3
Re: No escape character with dircect method call incfquery
Have you tried using CFQUERYPARAM for your insert value.
Phil
paross1 Guest



Reply With Quote

