Home » SQL & PL/SQL » SQL & PL/SQL » Instead of CONTINUE
Instead of CONTINUE [message #402270] Fri, 08 May 2009 06:02 Go to next message
ORAGENASHOK
Messages: 238
Registered: June 2006
Location: Chennai
Senior Member
In the below pl/sql block CONTINUE statements are used it is applicable for 11g.

But we can't use this CONTINUE command in oracle 9i
is there any way to implement this in oracle 9i


DECLARE
l_number NUMBER := 0;
BEGIN
FOR i IN 1 .. 100 LOOP
CONTINUE WHEN MOD(i,2) = 0;

-- Do something here!
l_number := l_number + 1;
END LOOP;

DBMS_OUTPUT.put_line('CONTINUE WHEN : ' || l_number);

l_number := 0;

FOR i IN 1 .. 100 LOOP
IF MOD(i,2) = 0 THEN
CONTINUE;
END IF;

-- Do something here!
l_number := l_number + 1;
END LOOP;

DBMS_OUTPUT.put_line('IF .. CONTINUE: ' || l_number);
END;
Re: Instead of CONTINUE [message #402272 is a reply to message #402270] Fri, 08 May 2009 06:06 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
DECLARE
 l_number NUMBER := 0;
 BEGIN
 FOR i IN 1 .. 100 LOOP
   IF NOT (MOD(i,2) = 0) THEN;
 
     -- Do something here!
     l_number := l_number + 1;
   END IF;
 END LOOP;
END;
/


Previous Topic: Excel Report From SP - ORA 29285 - file write error
Next Topic: SQL Query
Goto Forum:
  


Current Time: Mon Dec 05 10:37:23 CST 2016

Total time taken to generate the page: 0.12557 seconds