This script demonstrates GOTO : GOTO « PL SQL « Oracle PL / SQL






This script demonstrates GOTO

    
SQL>
SQL>
SQL> PROMPT ** GOTO
** GOTO
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.

   
    
    
    
  








Related examples in the same category

1.GOTO statement.
2.Example of a proper GOTO statement
3.GOTO a Label
4.Use GoTO to jump out of a loop
5.Use sequential control with the GOTO statement and a block label