All Forums Database
barani_sachin 141 posts Joined 01/12
25 Mar 2013
How to exit a SP?

Hi All,
    How to exit an SP in a midway if some conditions are met? is LEAVE the only option? Also in SP manual states that if leave is used all the open cursors will be closed in that block, if so is there some other means by which we can exit the SP midway without closing the cursors?

Tags:
teradata_techie 13 posts Joined 03/10
26 Mar 2013

Are you trying to build some LOOPs inside the Stored Procedure?

barani_sachin 141 posts Joined 01/12
26 Mar 2013

No looping constructs, only conditional checking.

dnoeth 4628 posts Joined 11/04
27 Mar 2013

You want to return a result set from the SP?
In that case you should be able to LEAVE, because AFAIK this only closes real cursors.
Dieter

Dieter

barani_sachin 141 posts Joined 01/12
27 Mar 2013

Yes Dieter, i want to retun a resultset; And leave is workign fine and returnign the resultsets.
Thanks all :)

You must sign in to leave a comment.