can someone tell me why...... after going thru the loop and if statement..and meeting the correct condition (lets say.. it found C).... instead of hitting the "exit when cursor not found", it goes up and starts the loop again... and then it raises one of the exceptions and quits. any ideas? must be my syntax

------------------------------------------------------------------
OPEN Cursor;

LOOP

Fetch x into v_xxx;

IF A then raise e_no_ids;

elsif B then raise e_ids;

elsif C then raise e_no_ids;

elsif D then update XXX;

elsif E then update YYY;

else Null;

END IF;

EXIT WHEN cursor%NOTFOUND;
END LOOP;


CLOSE cursor;

Commit;