If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Stored procedure in db2 which accepts any number of Arguments

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-05-07, 13:30
sampathm_78 sampathm_78 is offline
Registered User
 
Join Date: Mar 2007
Posts: 20
Stored procedure in db2 which accepts any number of Arguments

hi everyone..

i am working on DB2 UDB.
I Need a stored procedure in db2 which accepts any number of arguements..

regards,

M.Sampath.
Reply With Quote
  #2 (permalink)  
Old 03-05-07, 14:11
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
You cannot do it. What are you trying to do? Also give DB2 version and OS.

Andy
Reply With Quote
  #3 (permalink)  
Old 03-05-07, 14:15
sampathm_78 sampathm_78 is offline
Registered User
 
Join Date: Mar 2007
Posts: 20
The Requirement is that when we pass any no. of arguements it should accept it.


The version is Db2 V 8.2
OS -- Linux
Reply With Quote
  #4 (permalink)  
Old 03-05-07, 14:18
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
I understand your requirement even though it cannot be done. What I do not understand is what you want the SP to do. Maybe I can help with a work around.

Andy
Reply With Quote
  #5 (permalink)  
Old 03-05-07, 14:38
sampathm_78 sampathm_78 is offline
Registered User
 
Join Date: Mar 2007
Posts: 20
The criteria is the when we pass some IN Parameter( i.e some table names) so if some changes are made to the tables ,I must be in a position to pas all the table names in a loop.

I hope u got my point.

sampath
Reply With Quote
  #6 (permalink)  
Old 03-05-07, 14:47
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
No, I do not get your point. Please explain further. Perhaps some examples might help.

Andy
Reply With Quote
  #7 (permalink)  
Old 03-08-07, 08:17
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
The only option that you have is to
  1. not register the stored procedure, and
  2. use the parameter style DB2DARI

The consequence is that you would have to call the procedure this way:
Code:
CALL library!function(...)
I'm not sure if V8 still supports that mode. The DB2DARI parameter style is no longer supported (except for applications that require it for backward compatibility).

What I would do in your situation is to use a single table whose rows will describe the parameters that influence your procedure logic. The procedure scan over the table and does whatever it should do.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On