For loop in pl sql not working
I want to run the loop from i=1 to i=12 and insert each value of M_1,M_2 and so on till M_12 in M_Maintenance table.I have tried but it is not working.Please help me out.
The code which I have tried is:-
BEGIN
FOR i IN 1 .. 12
LOOP
DECLARE
M_i NUMBER;
MONTH_i_COUNT NUMBER;
M_i_Maintenance NUMBER;
MONTH_i_SUM NUMBER;
BEGIN
SELECT ROUND (
( ( (SELECT SUM (MONTH_i_COUNT)
FROM XXBAXY.XXBAXY_BREAKDOWN_TAB
WHERE LOSS_CAT = 'Maintenance Related Losses')
+ (SELECT MONTH_i_COUNT
FROM XXBAXY.XXBAXY_BREAKDOWN_TAB
WHERE LOSS_CAT = 'Maintenance Related Losses'