Can a SP input Parameter be an array? 
Author Message
 Can a SP input Parameter be an array?

I'm looking for some ideas on how to update, anywhere from 1 to 20 records,
with the same piece of data (Index number). Currently I'm using a SP and a
ADO command parameter, running it over and over, until all the target
records are updated.

I'm sure that I can build the ADO parameters dynamically but the question
is, how could I build the Stored Procedure Input Parameter(s) to accept a
variable number of inputs?

Should I build 20 Parameters and just not use the remainder, via some
decision loop?



Sat, 29 Nov 2003 23:16:10 GMT  
 Can a SP input Parameter be an array?
The best way for this in using xml string as a parameter. You can pass to SP
whatever you want in xml and then, in SP, parse this into separate local
parameters.

--
Mikhail Berlyant
Brainbench MVP for Visual Basic
http://www.brainbench.com
Distribution Systems Lead, Data Systems
http://www.launch.com


Quote:
> I'm looking for some ideas on how to update, anywhere from 1 to 20
records,
> with the same piece of data (Index number). Currently I'm using a SP and a
> ADO command parameter, running it over and over, until all the target
> records are updated.

> I'm sure that I can build the ADO parameters dynamically but the question
> is, how could I build the Stored Procedure Input Parameter(s) to accept a
> variable number of inputs?

> Should I build 20 Parameters and just not use the remainder, via some
> decision loop?



Sun, 30 Nov 2003 02:57:27 GMT  
 Can a SP input Parameter be an array?
Not exactly the answer I was looking for. I have absolutely no experience
with XML and don't have the slightest clue where to get started with
implementing your suggestion <sigh>.

Thanks anyway.

Mike


Quote:
> The best way for this in using xml string as a parameter. You can pass to
SP
> whatever you want in xml and then, in SP, parse this into separate local
> parameters.

> --
> Mikhail Berlyant
> Brainbench MVP for Visual Basic
> http://www.brainbench.com
> Distribution Systems Lead, Data Systems
> http://www.launch.com



Sun, 30 Nov 2003 05:51:21 GMT  
 Can a SP input Parameter be an array?
Use a SQL cursor and run the stored procedure on each row individually.

Brainbench certified VB6 and SQL7 developer
Home Page: http://partha.tripod.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sun, 30 Nov 2003 08:00:45 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Passing Array as Input Parameter to Oracle Stored Procedure

2. Passing Array as Input Parameter to Oracle Stored Procedure

3. Passing user defined data type as input to ORACLE SP

4. Trouble with SP output parameter

5. pass parameter to SQL SP from VB and return recordset

6. I can't call Oracle SP from VB5 with over 10 parameters

7. Passing parameters to IF-Statement SP

8. Active X control for collecting SP parameters

9. SP Parameters

10. Performing query past trough a parameter in a SP

11. Problem passing the default parameters in sp

12. Passing a adGuid parameters to a SP...

 

 
Powered by phpBB® Forum Software