The GOTO statement branches unconditionally to a statement label or block label. The label must be unique within its scope and must precede an executable statement or a PL/SQL block. The GOTO statement transfers control to the labelled statement or block.
Example:
"DECLARE
v_Counter BINARY_INTEGER := 1;
BEGIN
LOOP INSERT INTO MyTable VALUES (v_Counter, 'Loop count');
v_Counter := v_Counter + 1;
IF v_Counter > 50 THEN GOTO l_EndOfLoop; END IF;
END LOOP;
<>
INSERT INTO MyTable (char_col) VALUES ('Done!');
END;/"
INSERT INTO MyTable (char_col) VALUES ('Done!');
END;/"
No comments:
Post a Comment