Is there any statement relevant to GOTO in stored procedure language ?
My Scenario is :-
Insert ....Select .....;
IF SQLCODE < 0 THEN GOTO EROR_HANDLER;
my errortable is updated here with .
Basically , i want error table to updated with errorcode if any of my DML faces any error . I need to jump into a new label which i have set already . Please suggest with jumping options :P . ITERATE works only with LOOPS .
Thanks in Advance !!!
You can think of calling a stored proc from another one. In the called one you can put your if else condition. example
CREATE PROCEDURE Sp2(INOUT p1 INTEGER)
IF (.....) THEN
CALL Sp1(p1- 1);
Thats a brilliant Idea Raja !!!! Thanks !!! I would put all my error handlers in one stored proc and call it wherever required .:) :)