MySQL Forums
Forum List  »  Stored Procedures

Re: Calling store procedure
Posted by: John Readman
Date: November 14, 2005 11:10AM

>> CAN I call a store procedure inside a store procedure, if so how?

You can, just do CALL ProcName ();

However if you want to pass a value back from the proc you can't use the = construct, that would require a function as stated by Roland, but you can make one of the stored procedure parameters an output parameter if that suits your purpose.

e.g.

create procedure MyProc (OUT MyParam INT)
/* does something that gives MyParam a value */

...then inside another proc you can

declare MyVar INT;
call MyProc (MyVar);

MyVar contains the value from the procedure call.



Edited 1 time(s). Last edit at 11/14/2005 11:11AM by John Readman.

Options: ReplyQuote


Subject
Views
Written By
Posted
2214
November 14, 2005 06:37AM
1451
November 14, 2005 09:36AM
Re: Calling store procedure
1555
November 14, 2005 11:10AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.