Quantcast
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

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Comment moderation is enabled. Your comment may take some time to appear.