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 > Can I execute a stored proc thru SQL ? (DB2 OS390 ver 7)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-27-04, 16:51
MahendraSetty MahendraSetty is offline
Registered User
 
Join Date: Apr 2004
Posts: 48
Red face Can I execute a stored proc thru SQL ? (DB2 OS390 ver 7)

Hi
Can I execute a stored proc thru SQL ? (DB2 OS390 ver 7)

Thanks
Reply With Quote
  #2 (permalink)  
Old 04-28-04, 09:07
hiolgc hiolgc is offline
Registered User
 
Join Date: Mar 2004
Posts: 61
Yes, you can. Use call stored proc name.
Reply With Quote
  #3 (permalink)  
Old 04-28-04, 09:17
MahendraSetty MahendraSetty is offline
Registered User
 
Join Date: Apr 2004
Posts: 48
can you please give me some examples...

Thanks
Mahendra
Reply With Quote
  #4 (permalink)  
Old 04-28-04, 09:23
hiolgc hiolgc is offline
Registered User
 
Join Date: Mar 2004
Posts: 61
Call db2inst1.proc()
Reply With Quote
  #5 (permalink)  
Old 04-28-04, 10:01
MahendraSetty MahendraSetty is offline
Registered User
 
Join Date: Apr 2004
Posts: 48
Smile

I ment an example with sql statement like SELECT etc...

I was trying to use the stored proc TDB2PLDD.WCM888
This SP Accepts a parameter as partial string S1 and gets a value from column A of table 1 where that partial string is found.

So if we pass the parameter as tdb2pldd.wcm888(CIND) it should return value 'CINDY' from Table 1 if column A of the table is having the value CINDY

So how shall I frame my Select statement using this stored proc ?


Thanks for all the help/info

Mahendra
Reply With Quote
  #6 (permalink)  
Old 04-29-04, 16:11
dmmac dmmac is offline
Registered User
 
Join Date: Aug 2003
Location: Massachusetts, USA
Posts: 106
You cannot call a stored proc embedded into a SELECT statement. You can do what you need to do if you create a function. Suggest taking the proc code and creating a function.
Reply With Quote
  #7 (permalink)  
Old 04-29-04, 16:25
MahendraSetty MahendraSetty is offline
Registered User
 
Join Date: Apr 2004
Posts: 48
Thanks dmmac
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