Saturday, June 15, 2019

GOTO in PL/SQL

SQL> SET SERVEROUTPUT ON;
SQL>
SQL> DECLARE
  2     k   NUMBER := 10;
  3     v   NUMBER := 1;
  4  BEGIN
  5     GOTO hai;
  6
  7     IF k = NULL
  8     THEN
  9       <<hai>>
 10        v := v + 21;
 11     END IF;
 12
 13     /*<<hai>>
 14      v := v + 2;*/
 15
 16     DBMS_OUTPUT.put_line ('v=' || v);
 17  END;
 18  /
   GOTO hai;
   *
ERROR at line 5:
ORA-06550: line 5, column 4:
PLS-00375: illegal GOTO statement; this GOTO cannot branch to label 'HAI'
ORA-06550: line 8, column 4:
PL/SQL: Statement ignored


SQL>

No comments:

Post a Comment

Delete Row Button to all records of Interactive Report in Oracle Apex

 1. add 'Delete' Del column to Report Query 2. Set the Following Properties for the DEL Column Type: Link Heading: Delete Targ...