Isaac,

Thanks.

Sam




 --- On Wed 07/17, S.Isaac Dealey  wrote:
From: S.Isaac Dealey [mailto: [EMAIL PROTECTED]]
To: [EMAIL PROTECTED]
Date: Wed 07/17
Subject: Re: Build Query with IN in WHERE clause

> Hi Sam,
> 
> The problem you're running into involves one of the basic features of
> cfquery ( yes, it's a feature, not a bug ) ... When you place a variable
> within a cfquery tag, cf automatically escapes any single quotes in that
> variable, so that if you've created a form for users to insert data into
> the
> db and they type " margaret's stuff " into a form field, you can
> just say
> INSERT INTO userdata ( datacolumn ) VALUES ( '#form.userdata#' ) and you
> don't have to explicitly specify routines to escape the form variable
> when
> you insert or update the db.
> 
> So Allaire wisely provided a couple ways for us to use single quotes in
> queries ( less common ) with function calls... The most common functions
> used are ListQualify() and PreserveSingleQuotes ... In this case, what
> you
> want is something like this :
> 
> select * from employee where userid in (
> #ListQualify(ArrayToList(MyArray),"'")# )
> 
> hth
> 
> Isaac Dealey
> www.turnkey.to
> 954-776-0046
> 
______________________________________________________________________
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
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to