Demonstrate GOTO : GOTO « PL SQL Statements « Oracle PL/SQL Tutorial






SQL>
SQL>
SQL> SET SERVEROUTPUT ON
SQL> BEGIN
  2     DBMS_OUTPUT.PUT_LINE('BEGINNING OF BLOCK');
  3
  4     GOTO l_Last_Line;
  5
  6     DBMS_OUTPUT.PUT_LINE('GOTO didn''t work!');
  7     RETURN;
  8     <<l_Last_Line>>
  9     DBMS_OUTPUT.PUT_LINE('Last Line');
 10  END;
 11  /
BEGINNING OF BLOCK
Last Line

PL/SQL procedure successfully completed.

SQL>








22.5.GOTO
22.5.1.Labels and the GOTO Statement
22.5.2.An Example of the GOTO Statement
22.5.3.GOTO statement
22.5.4.Demonstrate GOTO
22.5.5.FOR LOOP with label
22.5.6.JUMP out of a IF statement