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
Tautology - Equivalences Rules: If there Tautologies are not all the time as much easy to note as the one above so than we can use these truth tables to be definite that a sta

SQL outer join SELECT * FROM IS_CALLED NATURAL LEFT JOIN IS_ENROLLED_ON Note that adding LEFT to an invocation of CROSS JOIN has no effect unless the right-hand operand

Updating by insertion Syntax : INSERT INTO ENROLMENT VALUES (SID ('S4'), 'Devinder', CID ('C1'));

Data Abstraction The Data abstraction extracts the important properties of data while ignoring the not necessary details. Once you design a data structure, you can fail to reme

First Step at defining type SID in SQL CREATE TYPE SID AS ( C VARCHAR(5) ) ; Explanation: TYPE SID announces that a type named SID is being defined to the syst

Parameter & Keyword Description: function_name: The user-defined function is identifying by that keyword. parameter_name: This identifies the formal parameter that

At times, customers make mistakes in submitting their orders and call to cancel the order. Brewbean's wants to create a trigger that automatically updates the stock level of all pr

Equivalences & Rewrite Rules: If notice that as well as allowing us to prove trivial theorems, and tautologies enable us to establish that certain sentences are saying the sam

Keyword & Parameter Description: boolean_expression: This is an expression which yields the Boolean value that is TRUE, FALSE, & NULL. character_expression: This

Tables within a Table - SQL Figure here is an exact copy of the one in the theory book and as before it is just an alternative way of representing some of the information con