ratliffjm
asked on
ADD 5 TO COUNTER IN FOR LOOP
How can I increment the count in a variable in the loop instead of codeing the actual numbers for the count such as (4,9,14,19,24). In other words, I just want to add 5 to the counter beginning with record number 4 in the loop. There can be up to 24 records in the loop.
This is an oracle table. I'm using PL/SQL.
See attached code.
This is an oracle table. I'm using PL/SQL.
See attached code.
v_count := 0
for c1 rec in c1 loop
v_count := v_count + 1;
if v_count in (4,9,14,19,24) then
put_line (l_file,'TEST1');
end if;
if v_count in (5,10,15,20) then
put_line(l_file,TEST2);
end if;
if v_count in (6,11,16,21)
put_line(l_file,TEST2);
end if;
end loop;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
glad I could help
ASKER