Dina Hess wrote:
But not when using cfqueryparam. Using cfqueryparam is meant to call the
functionality of the database driver to do the escaping. Any escaping done
by CF
before that will only result in doubling the quotes twice, and therefore
CF
should do no escaping whatsoever of any value
cfset value = String
cfquery ..
INSERT INTO table (field)
VALUES (cfqueryparam cfsqltype=cf_sql_varchar value=#value#
/cfquery
Make the value anything you want, quotes, backslashes etc., it will work.
I did...and it doesn't. But I think I know why now.
The inserted data has to be passed
-Original Message-
From: Dina Hess [mailto:[EMAIL PROTECTED]
Sent: Monday, February 24, 2003 12:06 PM
To: CF-Talk
Subject: Re: unexpeted result with cfqueryparam
I agree that Trim() should not influence a single quote. Nor should
HTMLEditFormat(). But both do, even without
Dina Hess wrote:
cfset value = String
cfquery ..
INSERT INTO table (field)
VALUES (cfqueryparam cfsqltype=cf_sql_varchar value=#value#
/cfquery
Make the value anything you want, quotes, backslashes etc., it will work.
I did...and it doesn't. But I think I know why now.
It doesn't? Even if you
I agree that Trim() should not influence a single quote. Nor should
HTMLEditFormat(). But both do, even without CFQUERYPARAM.
Please disregard the even without CFQUERYPARAM clause in the above
statement...that's not true. Can't imagine what in the world I was doing to
cause me to come to that
-Original Message-
From: Dina Hess [mailto:[EMAIL PROTECTED]
Sent: Monday, February 24, 2003 4:22 PM
To: CF-Talk
Subject: Re: unexpeted result with cfqueryparam
You have to perform all operations on the variable before you use it
in the SQL statement.
Not really. I mean
-Original Message-
From: Jochem van Dieten [mailto:[EMAIL PROTECTED]
Sent: Monday, February 24, 2003 4:20 PM
To: CF-Talk
Subject: Re: unexpeted result with cfqueryparam
Dina Hess wrote:
I agree that Trim() should not influence a single quote. Nor should
HTMLEditFormat
Andrew Tyrone wrote:
If it's a bug, it's been there since CF 4.0 at least, which is the version I
started with. Like I said in my first response, it makes sense to me that
CF doesn't escape the single quotes when you are running other functions on
the value.
It doesn't? How do you explain
-Original Message-
From: Jochem van Dieten [mailto:[EMAIL PROTECTED]
Sent: Monday, February 24, 2003 4:49 PM
To: CF-Talk
Subject: Re: unexpeted result with cfqueryparam
Andrew Tyrone wrote:
If it's a bug, it's been there since CF 4.0 at least, which is
the version I
started
Dina Hess wrote:
cfset value = String
cfquery ..
INSERT INTO table (field)
VALUES (cfqueryparam cfsqltype=cf_sql_varchar value=#value#
/cfquery
Make the value anything you want, quotes, backslashes etc., it will
work.
I did...and it doesn't. But I think I know why now.
It doesn't?
Dina Hess wrote:
Dina Hess wrote:
cfset value = String
cfquery ..
INSERT INTO table (field)
VALUES (cfqueryparam cfsqltype=cf_sql_varchar value=#value#
/cfquery
Make the value anything you want, quotes, backslashes etc., it will
work.
I did...and it doesn't. But I think I know why now.
It
: Monday, February 24, 2003 4:53 PM
Subject: Re: unexpeted result with cfqueryparam
Dina Hess wrote:
Dina Hess wrote:
cfset value = String
cfquery ..
INSERT INTO table (field)
VALUES (cfqueryparam cfsqltype=cf_sql_varchar value=#value#
/cfquery
Make the value anything you want, quotes
This behavior isn't a bug, although I can't explain why your code works in CF 5.
CF's normal behavior is to escape a single quote contained in a SQL string value by
doubling it. This is true whether you use the Trim() function or not. So you'll want
to use PreserveSingleQuotes() to prevent CF
-
From: [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Sunday, February 23, 2003 12:56 PM
Subject: unexpeted result with cfqueryparam
This behavior isn't a bug, although I can't explain why your code works in
CF 5.
CF's normal behavior is to escape a single quote contained in a SQL string
Quoting [EMAIL PROTECTED], [EMAIL PROTECTED] [EMAIL PROTECTED]:
This behavior isn't a bug, although I can't explain why your code works in CF 5.
I would disagree. I think it is a bug.
CF's normal behavior is to escape a single quote contained in a SQL string
value by doubling it. This is
But not when using cfqueryparam. Using cfqueryparam is meant to call the
functionality of the database driver to do the escaping. Any escaping done
by CF
before that will only result in doubling the quotes twice, and therefore
CF
should do no escaping whatsoever of any value passed through
What still doesn't seem to make sense is that using the trim() in the
cfqueryparam value does add an additional apostrophe, but not using trim()
doesn't.
Hmmmcould've sworn I tested this before but...I just tested
cfqueryparam cfsqltype=cf_sql_varchar value=#showLabel# / and, sure
enough,
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
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
, 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
-
From: Kevin Kazmierczak [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Thursday, February 20, 2003 11:09 AM
Subject: Re: unexpeted result with cfqueryparam
We have run across this problem also. We just didn't use cfqueryparam for
that field. What are you using for your database? We
I was mistaken. I accidentally tested the code on CF50, where it does work okay. On
CFMX, updating an Oracle database, it adds an apostrophe as you say. And it only does
it when trim() is used.
Brad and Kevin
Went back and tired not using the HTMLEditFormat--no difference. Also tried
; not just a feature of
cfqueryparam.? (Also same results on various databases.)
Thanks for input
Keith
- Original Message -
From: Brad Howerter [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Thursday, February 20, 2003 11:10 AM
Subject: unexpeted result with cfqueryparam
I was mistaken
23 matches
Mail list logo