December 2010
Intermediate to advanced
451 pages
11h 16m
English
If a specified conditional statement evaluates to TRUE, you want to terminate the current loop iteration of the loop early and start the next iteration immediately.
Use a CONTINUE statement along with a condition to end the current iteration.
In the following example, a loop is used to iterate through the records in the employees table. The primary reason for the loop is to print out a list of employees who receive a salary greater than 15,000. If an employee does not receive more than 15,000, then nothing is printed out, and the loop continues to the next iteration.
DECLARE
CURSOR emp_cur is
SELECT *
FROM employees;
emp_rec emp_cur%ROWTYPE;
BEGIN DBMS_OUTPUT.PUT_LINE('Employees ...Read now
Unlock full access