OracleBrains.Com header image 2

PL/SQL: New Statement ‘CONTINUE’

July 23rd, 2007 by Rajender Singh · No Comments

With this new statement CONTINUE, one can skip to the next iteration in a loop.

Even though this is a small improvement,In some cases it can come very handy in skipping rest of the processing without writing long IF statement.

Example of using new Statement CONTINUE:

CREATE PROCEDURE print_odd_no( l_from NUMBER, l_to NUMBER)
IS
BEGIN
FOR i IN l_from..l_to
LOOP
IF (MOD(i,2) = 0) THEN
CONTINUE;
END IF;
DBMS_OUTPUT.PUT_LINE(’i=’||to_char(i));
END LOOP;
END print_odd_no;


Tags: SQL and PL/SQL

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment