Example 1-11 Using the GOTO Statement
DECLARE total NUMBER(9) := 0; counter NUMBER(6) := 0; BEGIN <<calc_total>> counter := counter + 1; total := total + counter * counter; -- branch to print_total label when condition is true IF total > 25000 THEN GOTO print_total; ELSE GOTO calc_total; END IF; <<print_total>> DBMS_OUTPUT.PUT_LINE('Counter: ' || TO_CHAR(counter) || ' Total: ' || TO_CHAR(total)); END; /