Re: unexpeted result with cfqueryparam

2003-02-24 Thread Jochem van Dieten
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 passed through cfqueryparam.
 
 
 Yes, I do remember seeing your previous comments about using CFQUERYPARAM to
 preserve single quotes...but I could never get that to test out. Do you have
 a resource to share?

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.


 Maybe this is just another Access anomaly...

No, it is a CF MX anomaly.


 cfset variables.showLabel = abc's
 cfquery datasource=test
   UPDATE foo
   SET showLabel = cfqueryparam cfsqltype=cf_sql_varchar
 value=#trim(PreserveSingleQuotes(showLabel))# /
   where foo_id = 1
 /cfquery
 
 ...foo is now abc's in the database, which is what we want.
 
 But when I change the CFQUERYPARAM tag to cfqueryparam
 cfsqltype=cf_sql_varchar value=#trim(HTMLEditFormat(showLabel))# /
 
 ...foo becomes abc''s in the database

And that is the bug.


 If I change the CFQUERYPARAM tag again to cfqueryparam
 cfsqltype=cf_sql_varchar value=#trim(showLabel)# /
 foo is still abc''s

And if you leave the trim() out it will be abc's again. trim() should 
not influence the number of quotes, only the numer of spaces at the 
beginning and end of the string.

For a peak at the java behind the scenes, take a look at
http://spike.oli.tudelft.nl/jochemd/index.cfm?PageID=23

Jochem

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=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



Re: unexpeted result with cfqueryparam

2003-02-24 Thread Dina Hess
 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 directly from an HTML form to
CFQUERYPARAM.  In other words, you can't set the value directly using CFSET
and get the results you expect. But if you enter the value in an INPUT box
and send it directly to CFQUERYPARAM, it works great.

I've been using CFQUERYPARAM successfully for some time now. When I looked
at my code, I noticed that when I'm inserting form values into the DB, I
don't use any functions at all to wrap the form variables in the VALUE
attribute. But when I output, I wrap the DB values with both
HTMLEditFormat() and Trim(). There are all kinds of special characters in
the values I'm displaying, including single quotes. But this method of
handling the data seems to work very well.

 And if you leave the trim() out it will be abc's again. trim() should
 not influence the number of quotes, only the numer of spaces at the
 beginning and end of the string.

I agree that Trim() should not influence a single quote. Nor should
HTMLEditFormat(). But both do, even without CFQUERYPARAM.

Why?

 For a peak at the java behind the scenes, take a look at
 http://spike.oli.tudelft.nl/jochemd/index.cfm?PageID=23

Thanks for the link, Jochem...very helpful. I now have a much better
understanding of how Java uses JDBC to interact with a database
behind-the-scenes.

~Dina




~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: unexpeted result with cfqueryparam

2003-02-24 Thread Andrew Tyrone
 -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 CFQUERYPARAM.

 Why?

I encountered this some years ago for the first time when I was using
Evaluate() on a form field in my cfquery statement; I think this was on CF
4.0.  I can't be sure about this because I haven't performed any tests with
and without cfqueryparam, but I think CF doesn't automatically escape single
quotes if you are performing ANY functions on the variable inline of the
query.  You have to perform all operations on the variable before you use it
in the SQL statement.  The reason for this, I surmise, is that if you are
performing any operations on the variable, CF leaves it alone as it (maybe)
assumes you want to handle all processing of that variable.

--Andy


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=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



Re: unexpeted result with cfqueryparam

2003-02-24 Thread Jochem van Dieten
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 just use value=#value# without any function calls?


And if you leave the trim() out it will be abc's again. trim() should
not influence the number of quotes, only the numer of spaces at the
beginning and end of the string.
 
 
 I agree that Trim() should not influence a single quote. Nor should
 HTMLEditFormat(). But both do, even without CFQUERYPARAM.
 
 Why?

Bug.

Jochem

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



Re: unexpeted result with cfqueryparam

2003-02-24 Thread Dina Hess
  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 conclusion. Totally not true. Erase, erase...

You have to perform all operations on the variable before you use it
 in the SQL statement.

Not really. I mean, not if you're sending a form variable directly to
CFQUERYPARAM for a DB INSERT or UPDATE.

Maybe where the confusion comes in is that Trim() and HTMLEditFormat()
should be used to *display* information coming from the database, not to
manipulate the data before it goes in. CFQUERYPARAM does a great job of
getting the database to handle special characters for us, which is exactly
the point that Jochem was trying to get across, I'm sure.

But then I digressed... :)

~Dina

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=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



RE: unexpeted result with cfqueryparam

2003-02-24 Thread Andrew Tyrone
 -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, not if you're sending a form variable directly to
 CFQUERYPARAM for a DB INSERT or UPDATE.

Exactly.

That would mean you are not processing the FORM variable at all.  You are
sending it directly to the action page where it is used in a cfquery.  I was
referring to processing with other functions, such as Trim() or
HTMLEditFormat().  Sending the data directly to the query would mean you
aren't processing it inside your SQL Statement.

--Andy


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: unexpeted result with cfqueryparam

2003-02-24 Thread Andrew Tyrone
 -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(). But both do, even without CFQUERYPARAM.
 
  Why?


 Bug.

 Jochem


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's almost as if CF is saying Since you are adding additional
processing to the variable, I'm not touching it in case my automatic
escaping of single quotes messes up what you intended to do to the variable
inside the query.

--Andy


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



Re: unexpeted result with cfqueryparam

2003-02-24 Thread Jochem van Dieten
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 the doubling of the quotes when using 
cfqueryparam then?

Jochem

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: unexpeted result with cfqueryparam

2003-02-24 Thread Andrew Tyrone
 -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 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 the doubling of the quotes when using
 cfqueryparam then?

 Jochem

I was talking about running functions on the value, not about using
cfqueryparam.  I haven't tested with adding functions inside the value
attribute to the variable of cfqueryparam.  I was just offering the
observation that I've noticed the behavior of cfquery in general is that it
doesn't escape single quotes if you use functions on the value you are
passing in inside the query.  I tend to do all the processing on my
variables outside of cfquery/cfstoredproc.

--Andy


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



Re: unexpeted result with cfqueryparam

2003-02-24 Thread Dina Hess
 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 just use value=#value# without any function
calls?

Right. I was taking you literally. You said enter *anything.* :) But I can't
directly enter a double quote or a pound sign without escaping or CF will
throw an error...that's what I meant...and that's why I changed my testing
methodology to make use of form fields for the data entry.

~Dina


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



Re: unexpeted result with cfqueryparam

2003-02-24 Thread Jochem van Dieten
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 doesn't? Even if you just use value=#value# without any function
calls?
 
 Right. I was taking you literally. You said enter *anything.* :)

Anything isn't the problem, value is. I meant the variable named 
value, not the argument named value ;-)

Jochem

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



Re: unexpeted result with cfqueryparam

2003-02-24 Thread Dina Hess
Yes, but you are setting the value using CFSET and CF will throw an error if
you enter double quotes or pounds via CFSET without escaping. But I suspect
you knew what I meant... :)

~Dina

- Original Message -
From: Jochem van Dieten [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: 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, backslashes etc., it will
 work.
 
 I did...and it doesn't. But I think I know why now.
 
 It doesn't? Even if you just use value=#value# without any function
 calls?
 
  Right. I was taking you literally. You said enter *anything.* :)

 Anything isn't the problem, value is. I meant the variable named
 value, not the argument named value ;-)

 Jochem

 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



Re: unexpeted result with cfqueryparam

2003-02-23 Thread E. Keith Dodd
I didn't figure it was a bug, just couldn't see the reason for the behavior.

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. (In MX, at least.) I've used preserveSingleQuotes so doesn't
escape; but, haven't seen that as necessary when cfqueryparam is used. (Are
you suggesting to set the cfqueryparm
value=#PreserveSingleQuotes(formValue)# ?)

I began using the HTMLEditFormat for generated form values in either 4 or 5
because if someone used an apostrophe and this went directly to the database
as such, it truncated the entry at the spot of the apostrophe. Using
HTMLEditFormat was recommended somewhere along my learning and it worked to
prevent this truncation.

Thanks for the explanation.

Keith

E. Keith Dodd
Wings of Eagles Services
www.wingserv.com
- Original Message -
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
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
automatically escaping the single quotes in your SQL string values.

 The HTMLEditFormat function is used to preserve specific special
characters () that are used inside CFOUTPUT tags by converting them to
HTML codes (lt; etc.). But this function preserve *double* quotes, not
single quotes.

 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



Re: unexpeted result with cfqueryparam

2003-02-23 Thread Jochem van Dieten
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 true whether you use the Trim() function or
 not. So you'll want to use PreserveSingleQuotes() to prevent CF from
 automatically escaping the single quotes in your SQL string values. 

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 cfqueryparam.

Jochem
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



Re: unexpeted result with cfqueryparam

2003-02-23 Thread Dina Hess
 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 cfqueryparam.


Yes, I do remember seeing your previous comments about using CFQUERYPARAM to
preserve single quotes...but I could never get that to test out. Do you have
a resource to share? Maybe this is just another Access anomaly...

Anyway, here's some test code I ran (CFMX/Access) before sending my last
post...

cfset variables.showLabel = abc's
cfquery datasource=test
  UPDATE foo
  SET showLabel = cfqueryparam cfsqltype=cf_sql_varchar
value=#trim(PreserveSingleQuotes(showLabel))# /
  where foo_id = 1
/cfquery

...foo is now abc's in the database, which is what we want.

But when I change the CFQUERYPARAM tag to cfqueryparam
cfsqltype=cf_sql_varchar value=#trim(HTMLEditFormat(showLabel))# /

...foo becomes abc''s in the database

If I change the CFQUERYPARAM tag again to cfqueryparam
cfsqltype=cf_sql_varchar value=#trim(showLabel)# /

foo is still abc''s




~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



Re: unexpeted result with cfqueryparam

2003-02-23 Thread Dina Hess
 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, foo becomes abc's again...just what we want. So...I guess as long as
we leave well enough alone (that is, don't use *any* functions with
CFQUERYPARAM), CFQUERYPARAM gets the database to do all the work, right?

~Dina






~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



Re: unexpeted result with cfqueryparam

2003-02-20 Thread Kevin Kazmierczak
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=subscribeforumid=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




Re: unexpeted result with cfqueryparam

2003-02-20 Thread E. Keith Dodd
Brad and Kevin

Went back and tired not using the HTMLEditFormat--no difference. Also tried
bypassing the CFC and argumentcollection, doing a direct update. No
difference.
Seems to be something only with the cfqueryparam and trim.

Again, without the trim, works as expected. With a trim, get the additional
'.
Should have said that using MX.
Am using Access as database.

Kevin: I am able to use the cfqueryparm (or regular sql) with an apostrophe
IF I use the HTMLFormat on the initial field value. It's only when I added
the trim that noticed the problem.

Keith
- Original Message -
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 are using SQL
server.


 Kevin Kazmierczak.



-
[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=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4




Re: unexpeted result with cfqueryparam

2003-02-20 Thread E. Keith Dodd
Glad to know the 5.0 result. I was just going to test it on 5.0.
So, in summary (correct me if wrong):

In MX, but not 5.0, using trim with the value attribute of cfqueryparam adds
an additional apostrophe (assuming one existed in the field).

So inconsistent behavior in this from 5 to MX; 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.  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.




-
[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=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4