PDA

View Full Version : How to stop and return from a stored procedure



ZH LIN
10-01-2007, 10:21 AM
Dear all,

This question is regarding MySQL stored procedure.

I would like to stop and return from the middle of a stored procedure (SP). As SP does not have a RETURN command, how can I do this?

Here is an example:

create procedure test()
begin
...
...
return; <-- how to do something like this?
...
...
end
//

Thank you!

Twey
10-01-2007, 04:41 PM
You can always use IF.