EXIT Statement in PL/SQL

The EXIT statement forces a loop to complete unconditionally. When an EXIT statement is encountered, the loop completes immediately and control passes to the next statement.

An Example follows:

LOOP

IF emp_rating < 3 THEN

–Some executable statements

EXIT; — exit loop immediately

END IF;

END LOOP;
– control resumes here

Remember, the EXIT statement must be placed inside a loop. To complete a
PL/SQL block before its normal end is reached, you can use the RETURN statement.

Read more about RETURN statement in PL SQL

No comments

There are still no comments on this article.

Leave your comment...

If you want to leave your comment on this article, simply fill out the next form:




CAPTCHA Image CAPTCHA Audio
Refresh Image

You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .