Hi All
I think I didn't clearly wrote my requirement. My requirement is to come to start of loop whenever I need. I am looking for some command like 'BREAK' , which immediately comes out of the loop. Here instead of going out, I want to go to 'start' of the loop.
It should be just like 'CONTINUE" command in some of the languages which takes control to the start of loop.
FOR I in 1..4 LOOP
IF I=2 THEN
<< here I want to go to start of loop for next value of I>>
ELSE
DBMS_OUTPUT.PUT_LINE('value of I is ' || I);
END IF;
<<some other executable statements>>
END LOOP;
-----Original Message-----
From: Ning Wong [mailto:[Email address protected]
Sent: Wednesday, August 02, 2006 4:58 PM
To: Abhishek.Goel
Subject: RE: basic question for loop
**A LazyDBA.com subscriber has responded to your lazydba.com post**
**LazyDBA.com mail shield has forwarded you this email,
**and removed any attachments, and kept your email address secret
**from this person, and any viruses/trojans.
**If you reply to this email, the person will see your email address as normal
**Anything below this line is the original email text
FOR I in 1..4 LOOP
IF I=2 THEN
<< here I want to go to start of loop for next value of I>>
null; --
ELSE
DBMS_OUTPUT.PUT_LINE('value of I is ' || I);
END IF;
END LOOP;
or
FOR I in 1..4 LOOP
IF I<>2 THEN
DBMS_OUTPUT.PUT_LINE('value of I is ' || I);
END IF;
END LOOP;
-----Original Message-----
From: Abhishek.Goel
[Email address protected]
Sent: Wednesday, August 02, 2006 2:53 PM
To: LazyDBA Discussion
Subject: basic question for loop
Hi All
I have one basic question..
I have one FOR LOOP and want to goto start of loop for next value of I, NOTE: I am not suppose to use GOTO statement.
FOR I in 1..4 LOOP
IF I=2 THEN
<< here I want to go to start of loop for next value of I>>
ELSE
DBMS_OUTPUT.PUT_LINE('value of I is ' || I);
END IF;
END LOOP;
--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these terms:http://www.lazydba.com/legal.html
Oracle LazyDBA home page