dbTalk Databases Forums  

(noob) 8.5 call procedure with parameters and loop through list

comp.database.oracle comp.database.oracle


Discuss (noob) 8.5 call procedure with parameters and loop through list in the comp.database.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Chris Cowles
 
Posts: n/a

Default (noob) 8.5 call procedure with parameters and loop through list - 06-28-2005 , 07:50 PM






We're using an vendor-supplied application that uses procedures. I need to
run a script that calls one of the procedures to update some tables, and
need to do it repeatedly on multiple records. I can do it with direct
updates but use of the procedure is much preferred.

The procedure requires parameters A, B, and C. I know I can invoke the
procedure with:

call procedure(A,B,C)

but I also need to do it repeatedly, with for example:

call procedure(D,E,F)
call procedure(G,H,I)

Given a list of parameters, is there a simple way to loop through multiple
calls? Maybe something like (making this up):

Call procedure(?,?,?)

using parameters(A,B,C)
(D,E,F)
(G,H,I)

Thanks in advance for any assistance offered.

Chris Cowles
Gainesville, FL



Reply With Quote
  #2  
Old   
Hilarion
 
Posts: n/a

Default Re: (noob) 8.5 call procedure with parameters and loop through list - 06-29-2005 , 09:16 AM






Quote:
Given a list of parameters, is there a simple way to loop through multiple
calls? Maybe something like (making this up):

Call procedure(?,?,?)

using parameters(A,B,C)
(D,E,F)
(G,H,I)

I think you could put parameter values in table variable and loop through
it and call the procedure with the values from the table variable.
It can also be done by storing the parameter values in a database table
(may be temporary table) and using cursor to loop through it and
execute the procedure.

Hilarion


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.