Iterative control:exit statements, PL-SQL Programming

EXIT

The EXIT statement forces a loop to done unconditionally. Whenever an EXIT statement is encountered, the loop is done immediately and controls the passes to the next statement. An illustration is as shown below:

LOOP
...
IF credit_rating < 3 THEN
...
EXIT; -- exit loop immediately
END IF;
END LOOP;                   -- control resumes here


The later example represents that you cannot use the EXIT statement to complete a PL/SQL block:

BEGIN
...
IF credit_rating < 3 THEN
...
EXIT; -- illegal
END IF;
END;


Keep in mind that, the EXIT statement should be placed inside a loop. To complete the PL/SQL block before its normal end is reached; you can use the RETURN statement.

Posted Date: 10/3/2012 5:45:14 AM | Location : United States







Related Discussions:- Iterative control:exit statements, Assignment Help, Ask Question on Iterative control:exit statements, Get Answer, Expert's Help, Iterative control:exit statements Discussions

Write discussion on Iterative control:exit statements
Your posts are moderated
Related Questions
Parameter and Keyword Description: EXIT: An unconditional EXIT statement (i.e., one without a WHEN clause) exits the present loop instantly. The Execution resumes with th

Using Cursor Attributes To process the SQL data manipulation statements, the SQL engine must opens an implicit cursor named SQL. This cursor's attributes (%FOUND, %NOTFOUND, %

Datatype Conversion At times it is necessary to convert a value from one datatype to another. For e.g. if you want to inspect a rowid, you should convert it to a character stri

LIKE Operator You use the LIKE operator to compare the character value to a pattern. The Case is significant. LIKE returns the Boolean value TRUE when the character patterns mat

FETCH Statement The FETCH statement retrieve rows of data one at a time from the result set of the multi-row query. The data is stored in fields or variables which correspond t

JOIN and AND in SQL In this Section is all about one operator, JOIN. SQL's closest counterpart, NATURAL JOIN, has already been covered. Here we look at several other "join" op

I need SQL Data Base Project Description: Network SQL database and SQL Setup two 4 workstation Skills required are Data Entry, MySQL, SQL

What Is a Package? The package is a schema object that group logically related PL/SQL items, types, and subprograms. The Packages usually have 2 parts, a specification & a bo

Write SQL queries to solve the following specifications. Include the query AND THE OUTPUT.  A screen dump of the output is acceptable. Show as many rows as you can. A screen dump i

COMMIT Statement The COMMIT statement explicitly makes everlasting changes to the database during the present transaction. The Changes made to the database are not considered e