PL/SQL GOTO Statement
PL/SQL GOTO Statements (Sequential Control Statements) are control your iteration loop. PL/SQL GOTO Statement transfers the program execution flow unconditionally.
GOTO Statement
GOTO statement unconditionally transfer program control. GOTO statement writing syntax,
Syntax
GOTO code_name
-----------
-----------
<<code_name>>
-----------
-----------
Example
SQL>BEGIN
FOR i IN 1..5 LOOP
dbms_output.put_line(i);
IF i=4 THEN
GOTO label1;
END IF;
END LOOP;
<<label1>>
DBMS_OUTPUT.PUT_LINE('Row Filled');
END;
/
Result
1
2
3
4
Row Filled
PL/SQL procedure successfully completed.
2
3
4
Row Filled
PL/SQL procedure successfully completed.