By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,351 Members | 1,246 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,351 IT Pros & Developers. It's quick & easy.

Call Stored Procedure from Function

akashazad
P: 38
Hi Friends
My question is "can we call Stored Procedure from a User Defined Function in SQL"

If yes then pl tell me how?

If No then pl tell me why not ?

While I was trying finding about the this question on internet I m getting both kind of answers hence I am confused .

Pl help,Thanx in advance
Feb 22 '10 #1
Share this Question
Share on Google+
3 Replies


Atli
Expert 5K+
P: 5,058
Hey.

Sure you can. You just call it like you would from anywhere else.
Expand|Select|Wrap|Line Numbers
  1. CALL `myProcedure`('parameter1', 'etc...');
There are some limitations to how procedures can be called from Triggers, though. (See the manual for details on what those are exactly.)
Feb 22 '10 #2

akashazad
P: 38
@Atli
Hey Atil
Thanx for the reply

but can you just explain it a bit more because I am not getting it properly
Feb 23 '10 #3

Atli
Expert 5K+
P: 5,058
There isn't much to explain, really. Calling a stored procedure from within a user function is exactly like calling a procedure by itself... You just issue a CALL command where you want the procedure to be called.

If that isn't making sense, you may want to brush up on the way functions work.
Feb 23 '10 #4

Post your reply

Sign in to post your reply or Sign up for a free account.