|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 11/6/2008 1:53:32 AM
Posts: 6,
Visits: 22
|
|
All,
Is there any way to perform branching to a specific label in stored procedure. Based on my input value i have to execute one part of my code and stop my execution. Please let me know how this can be achieved.
Thanks,
Arun
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: 11/21/2008 10:45:25 PM
Posts: 79,
Visits: 98
|
|
Use the LEAVE control statement to exit a compound block.
CREATE PROCEDURE mysqlsp(IN options INTEGER)
BEGIN
DoWork: BEGIN
-- test option
IF options IS NULL THEN LEAVE DoWork; END IF;
-- do SQL here
END DoWork; -- label name optional here
-- cleanup code here
END;
|
|
|
|