EXIT From FOREACH Statements

If the EXIT statement has the FOREACH statement as its innermost enclosing statement, the FOREACH keyword must immediately follow the EXIT keyword. The EXIT FOREACH statement unconditionally terminates the FOREACH statement, or else returns an error, if no FOREACH statement encloses the EXIT FOREACH statement.

The following program fragment includes the EXIT FOREACH statement:
FOREACH cursor1 FOR
      SELECT * INTO a FROM TABLE(b);
      IF a = 4 THEN
         DELETE FROM TABLE(b) 
            WHERE CURRENT OF cursor1;4
         EXIT FOREACH;
      END IF;
   END FOREACH;