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 > How to call procedure with OUT value only

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-22-04, 02:30
sw_flintstone sw_flintstone is offline
Registered User
 
Join Date: Jun 2004
Posts: 13
How to call procedure with OUT value only

Hi

I am confused about calling a procedure with just OUT value into a normal variable.

<varname> = CALL <procedure_name>;

but its not working.

Please tell me the right way to do this. I dont want to use a host variable for this.
Reply With Quote
  #2 (permalink)  
Old 09-22-04, 07:54
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
From the CLP you would call it like this:

Call MyProc(?,?,?)

assuming it had 3 out parameters.

Andy
Reply With Quote
  #3 (permalink)  
Old 09-23-04, 00:24
sw_flintstone sw_flintstone is offline
Registered User
 
Join Date: Jun 2004
Posts: 13
Yeah whatever you said is the right way to invoke but if I use '?' then how will I make sure that I get the value of the procedure in which variable.

I mean if my proc is myProc(?,?,?) and I have to store the OUT values in Var1, Var2 and Var3. How to do that?

I think you got my question. Also I dont want to use any Host Variables.
Reply With Quote
  #4 (permalink)  
Old 09-23-04, 01:45
jsp2999 jsp2999 is offline
Registered User
 
Join Date: Jul 2004
Posts: 76
Here is the way

Assume that you have one variable named out_var1 in which you want to store the value of out put parameter of the SP.

Then make a call in following manner.

call SP_NAME(out_var1);
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