Re: [KCFusion] CFQUERY and single quotes

2001-02-01 Thread Daryl Banttari

Not sure what you're asking...
select * from users where name = 'me'
is valid where the name column is a text type
select  * from users where userID = 3
is valid where the userID column is a numeric type, and
select * from eventlog where logtimestamp  #createODBCDate(now())#
will get today's eventlog entries if the logtimestamp column is a date/time
field.

If you have a form field called (e.g.) "Form.Comments" and the comments
include a single quote:
insert into CommentLog (comment) values ('#Form.Comments#')
then CF is smart enough to "escape" the tick quotes by doubling them before
sending the query to the DBMS.  For example, the actual insert might look
like this to the SQL engine:
insert into CommentLog (comment) values ('This site''s cool, dude!')

...Is this what you're asking?

Daryl

- Original Message -
From: "Bryan LaPlante" [EMAIL PROTECTED]
To: "[KCFusion List] (E-mail)" [EMAIL PROTECTED]
Cc: "[CF-Server List][E-Mail]" [EMAIL PROTECTED]
Sent: Thursday, February 01, 2001 4:51 PM
Subject: [KCFusion] CFQUERY and single quotes


 I am having a problem with a textarea that I use to send queries through
CF
 via the CFQUERY tag.
 If I write a query that references a string value like [ select * from
users
 where name = 'me' ] the database says syntax error or access violation. If
 on the other hand the query goes [ select  * from users where userID = 3 ]
 then the query runs fine.

 Has anyone else found a work-a-round for this?

 Bryan LaPlante
 816-347-8220
 [EMAIL PROTECTED]
 http://www.netwebapps.com
 Web Development



 __
 The KCFusion.org list and website is hosted by Humankind Systems, Inc.
 List Archives http://www.mail-archive.com/cf-list@kcfusion.org
 Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED]
 To Subscribe mailto:[EMAIL PROTECTED]
 To Unsubscribe mailto:[EMAIL PROTECTED]



 
 
__
The KCFusion.org list and website is hosted by Humankind Systems, Inc.
List Archives http://www.mail-archive.com/cf-list@kcfusion.org
Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED]
To Subscribe mailto:[EMAIL PROTECTED]
To Unsubscribe mailto:[EMAIL PROTECTED]
 



Re: [KCFusion] CFQUERY and single quotes

2001-02-01 Thread Daryl Banttari

Oh, wait... I think I understand your question now.

You may need to use the PreserveSingleQuotes() function around the form
field to prevent CF from doubling the single quotes, i.e. passing your query
as such:
select * from users where name = ''me''

Daryl

- Original Message -
From: "Bryan LaPlante" [EMAIL PROTECTED]
To: "[KCFusion List] (E-mail)" [EMAIL PROTECTED]
Cc: "[CF-Server List][E-Mail]" [EMAIL PROTECTED]
Sent: Thursday, February 01, 2001 4:51 PM
Subject: [KCFusion] CFQUERY and single quotes


 I am having a problem with a textarea that I use to send queries through
CF
 via the CFQUERY tag.
 If I write a query that references a string value like [ select * from
users
 where name = 'me' ] the database says syntax error or access violation. If
 on the other hand the query goes [ select  * from users where userID = 3 ]
 then the query runs fine.

 Has anyone else found a work-a-round for this?

 Bryan LaPlante
 816-347-8220
 [EMAIL PROTECTED]
 http://www.netwebapps.com
 Web Development



 __
 The KCFusion.org list and website is hosted by Humankind Systems, Inc.
 List Archives http://www.mail-archive.com/cf-list@kcfusion.org
 Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED]
 To Subscribe mailto:[EMAIL PROTECTED]
 To Unsubscribe mailto:[EMAIL PROTECTED]



 
 
__
The KCFusion.org list and website is hosted by Humankind Systems, Inc.
List Archives http://www.mail-archive.com/cf-list@kcfusion.org
Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED]
To Subscribe mailto:[EMAIL PROTECTED]
To Unsubscribe mailto:[EMAIL PROTECTED]