Oracle PL/SQL - What is the output: GOTO Statement?

Question

What is the output of the following code?

DECLARE 
  valid BOOLEAN := TRUE; 
BEGIN 
  GOTO update_row; 
   
  IF valid THEN 
  <<update_row>> 
    NULL; 
  END IF; 
END; 
/ 


Click to view the answer

GOTO update_row; 
  * 
ERROR at line 4: 
ORA-06550: line 4, column 3: 
PLS-00375: illegal GOTO statement; this GOTO cannot transfer control to label 
'UPDATE_ROW' 
ORA-06550: line 6, column 12: 
PL/SQL: Statement ignored

Note

The GOTO statement transfers control to the first enclosing block in which the referenced label appears.

The GOTO statement transfers control into an IF statement, causing an error.

Related Quiz