Just use #preserveSingleQuotes( sWhere )# if you don't want CF to escape the
quotes.

Now if office is a number you shouldn't use quotes around it because that
makes it a String which is, obviously, not a number...

If that's the case, then Terry's answer should do.

Marc

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of [EMAIL PROTECTED]
> Sent: Thursday, February 28, 2002 1:48 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [CFTALKTor] Passing string into a query
>
>
> It looks to me like you have found a CF bug.  The CFQUERY tag is trying to
> be too smart by protecting you from yourself and wrapping your query value
> in single quotes.
>
> If this indeed the case, what happens if you do this:
>
> <cfset sWhere = "where office = 90">
>
> This may be a valid workaround.
>
> Terry
>
>
> On Thu, 28 Feb 2002, Glenn Shukster wrote:
>
> > In creating a complex query I wanted to first put all the where clause
> > into a string.  Then when its done put it in the query.
> >
> > simple example.
> >
> > <cfSet sWhere = "where office = '90'">
> >
> > <cfQuery ...>
> > Select * from MyTable
> > #sWhere#
> > </cfQuery>
> >
> > The query bombs and in the debug code it shows two sets of quotes around
> > 90.
> > office = ''90''
> >
> > What am I doing wrong?
> >
>
> --
> Terry Fielder
> Network Engineer
> Great Gulf Homes / Ashton Woods Homes
>
> -
> You are subscribed to the CFUGToronto CFTALK ListSRV.
> This message has been posted by: [EMAIL PROTECTED]
> To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
> Manager: Kevin Towes ([EMAIL PROTECTED])
> http://www.CFUGToronto.org/
> This System has been donated by Infopreneur, Inc.
> (http://www.infopreneur.net)
>

-
You are subscribed to the CFUGToronto CFTALK ListSRV.
This message has been posted by: "Marc Campeau" <[EMAIL PROTECTED]>
To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
This System has been donated by Infopreneur, Inc.
(http://www.infopreneur.net)

Reply via email to