Here's a little test I did. The trick is to use the LIST attribute of the
cfqueryparam tag:
<!--- START cfqueryparam_multi.cfm --->
<cfset IntList = "1,2">
<cfquery datasource="for_testing" name="testqry">
SELECT *
FROM
Widgets
WHERE Product IN (<cfqueryparam cfsqltype="CF_SQL_INTEGER" list="Yes"
value="#IntList#">)
</cfquery>
<!--- END cfqueryparam_multi.cfm --->
> -----Original Message-----
> From: Robert Everland [mailto:REverland@;dixonusa.com]
> Sent: Friday, November 01, 2002 3:16 PM
> To: CF-Talk
> Subject: Cfqueryparam and IN
>
>
> I have a query that I had been just comparing one value so I could use a
> cfqueryparam of varchar, now that same variables may be passing something
> like 203,197 meaning that a sales rep belongs to each of those
> groups. So I
> need to change my query to something IN ('203','197') , but cfqueryparam
> doesn't let me do this. Do I need to use something else besides
> cfqueryparam
> or is there a setting I am not seeing that will allow me to use
> cfqueryparam
> and this?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=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.