As far as I know, it's cf being nice and trying to help your strings
get into SQL statements more easily.
Like so:
<cfset text = "my 'first' name">
<cfquery datasource="foo">
UPDATE table SET column = '#text#'
</cfquery>
...CF would automatically escape the single quotes in #text# so that
you don't need to do so.
-joe
----- Original Message -----
From: Dustin Snell [Unisyn Software, LLC] <[EMAIL PROTECTED]>
Date: Fri, 25 Jun 2004 08:21:29 -0700
Subject: RE: So weird - cannot use variable for query in CFQUERY
To: CF-Talk <[EMAIL PROTECTED]>
You were correct. Could you please explain to me how/why this happens?
-Dustin
_____
From: Joe Rinehart [mailto:[EMAIL PROTECTED]
Sent: Friday, June 25, 2004 8:00 AM
To: CF-Talk
Subject: Re: So weird - cannot use variable for query in CFQUERY
I think you've having a problem with single quotes being escaped....try:
<cfquery name="getdomaindupes" datasource="#datasource#">
#preserveSingleQuotes(myquery)#
</CFQUERY>
-joe
----- Original Message -----
From: Dustin Snell [Unisyn Software, LLC] <[EMAIL PROTECTED]>
Date: Fri, 25 Jun 2004 07:53:16 -0700
Subject: So weird - cannot use variable for query in CFQUERY
To: CF-Talk <[EMAIL PROTECTED]>
Using CF MX 6.1 with MSSQL 2000 on Windows 2003 Server
Regardless of the query used the following code gives me an
"Macromedia][SQLServer JDBC Driver][SQLServer]Line 1: Incorrect syntax "
error:
<cfset myquery="select Count(*) as thecount from cdomains where
thedomain='#ListGetAt(getcustomer.email,2,"@")#';">
<cfoutput>#myquery#</cfoutput>
<cfquery name="getdomaindupes"
datasource="#datasource#">#myquery#</CFQUERY>
However it works if I don't use a variable and instead literally put the
same query inside the query block:
<cfquery name="getdomaindupes" datasource="#datasource#">
select Count(*) as thecount from cdomains where
thedomain='#ListGetAt(getcustomer.email,2,"@")#';</CFQUERY>
I have been working on this for hours and can't figure it out. I know I have
stored my queries in variables before but it won't work in this case.
Anyone ever seen this?
-Dustin Snell
Unisyn Software, LLC________________________________
_____________________________________
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
[Donations and Support]
- how to open an attached file in its ow... cf coder
- Re: how to open an attached file ... Dave Carabetta
- Re: how to open an attached f... cf coder
- Re: how to open an attach... John Beynon
- So weird - cannot use... Dustin Snell [Unisyn Software, LLC]
- RE: So weird - c... Tony Weeg
- Re: So weird - c... Joe Rinehart
- RE: So weird... Dustin Snell [Unisyn Software, LLC]
- RE: how ... Joe Rinehart
- RE: how to open an attached file ... Samuel Neff
- Re: how to open an attached file ... dave
- RE: how to open an attached file ... Douglas.Knudsen
- RE: how to open an attached file ... Alistair Davidson
- Re: how to open an attached f... cf coder
- Re: how to open an attached f... cf coder
- Re: how to open an attach... cf coder
- Re: how to open an at... Stephen Moretti (cfmaster)
- RE: how to open an attached file ... Pascal Peters
- RE: how to open an attached file ... WebSite CFtalk