Declare
var_cnt number(3):=0;
begin
loop
update t_loan_dtl set loan_closure = 'Y' where rownum <10001;
end loop;
end;
simple exit
loop --do something; exit; end loop;
conditional exit
loop --do something; exit when "condition"; end loop;
3.Exit with cursor variable
exit when v_cursor%notfound;