Index | Home | Forums
Oracle PL/SQL Example 4-18 Using EXIT With a Label in a LOOP

Example 4-18 Using EXIT With a Label in a LOOP

DECLARE
   v_employees employees%ROWTYPE;  -- declare record variable
   CURSOR c1 is SELECT * FROM employees;
BEGIN
  OPEN c1; -- open the cursor before fetching
-- An entire row is fetched into the v_employees record
<<outer_loop>>
  FOR i IN 1..10 LOOP
    -- process data here
    FOR j IN 1..10 LOOP
      FETCH c1 INTO v_employees;
      EXIT WHEN c1%NOTFOUND;
      -- process data here
    END LOOP;
  END LOOP outer_loop;
  CLOSE c1;
END;
/


This page was created by oracleabc.com on Feb 23,2008 00:09:02
General comments and questions regarding this document should be sent by email to info@oracleabc.com or post your comments here