MySQL Forums
Forum List  »  Stored Procedures

Re: How to use a stored procedure in a select structure?
Posted by: Andrew Gilfrin
Date: November 16, 2005 08:25AM

Just to add a little flesh to the bones and in case anybody is interested....

The reason you can't use a procedure in SQL is because you (or more importantly MySQL) cannot be sure that the procedure will return a single value (and only a single value). With a function, by it's very nature MySQL knows that it will return 1 value, always return one value and can only ever return one value.

Therefore it's safe for MySQL to process the function in SQL because it knows how the function will respond, with procedures there is no way to know this for sure.

Andrew Gilfrin
------------------
http://gilfster.blogspot.com
My MySQL related Blog

http://www.mysqldevelopment.com
MySQL Stored Procedure,Trigger, View.... (Just about most things these days) Information

Options: ReplyQuote




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.