Branching in stored procedures
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


Branching in stored procedures Expand / Collapse
Author
Message
Posted 5/15/2008 3:02:51 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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
Post #11445
Posted 5/15/2008 5:29:26 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme 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;
Post #11459
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 2 ( 2 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 8:23pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.141. 9 queries. Compression Disabled.