DB version:10g release 2
I am currently learning the basics of loop in PL/SQL. I understand normal loops like the one below where a rec (a PL/SQL RECORD) stores all the rows in emp table and emp_dtl.emp_daily_track_nbr is getting updated with sysdate in MMDDYYYY format within a loop.
But can anyone show me a scenario of where a loop inside a loop is used? Is a loop inside a loop efficient?
--looping through emp rows
FOR i IN rec.emp.First..rec.emp.COUNT LOOP
BEGIN
update emp_dtl set
emp_daily_track_nbr = to_char(sysdate,'MMDDYYYY')
where emp_dtl.emp_id = rec.empno(i);
end loop;
end.