Send each element of the list as it's own <cfprocparam>. Like this:

<cfstoredproc procedure="procedure" datasource="#dsn1#" returncode="No"
debug="No">
  <cfloop index="this" list="#list#">
    <cfprocparam type="In" cfsqltype="CF_SQL_INTEGER" value="#this#">
  </cfloop>
</cfstoredproc>

That will send the values to the stored proc as (value1,value2,valueN).

Mike Wallick
* Web Application Developer
* [EMAIL PROTECTED]
* 651.628.5377
* http://www.securecomputing.com/


-----Original Message-----
From: Jason [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 10, 2002 10:17 AM
To: CF-Talk
Subject: Passing a list to a Stored Procedure


Sorry for the somewhat OT Post, but this is one of my better resources for
CF I have

I was wondering if anybody had any code snippets for passing a list to a SQL
Server 2000 stored procedure. I have the CF front-end working fine but when
I send the list (61755,61754) to the stored procedure I get no results, when
I pass a singe variable (61755), I get the results that I am looking for. 

Here is my stored procedure:

CREATE PROCEDURE MasterAssignments 
@ClientList nvarchar (4000)
AS

SELECT     Assignments.dbnum, Master.prim_name, Master.prim_ssn,
SUM(Assignments.currbal) AS TotalBalance
FROM         Assignments INNER JOIN Master ON Master.dbnum =
Assignments.dbnum
WHERE Assignments.clnt IN (@clientList)
GROUP BY Assignments.dbnum, Master.prim_name, Master.prim_ssn ORDER BY
Master.prim_name GO

Any suggestions or leads would be very helpful, I have been working on this
problem for a couple of days know

Thanks
Jason Larson
[EMAIL PROTECTED]



______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.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