Hi All,
I have two cursor. One is for getting dates for one month and other is for doing some calculations based on date. Both these cursor are parameterized.
When I am trying to get values from them it seems control is not going into second loop (for second cursor). Pls help me to understand the reason.
Below is the code I am using.
Cursor c_date(b_mydate DATE)
----getting dates for month of given date
Cursor c_cal(cont_id VARCHAR2, b_date DATE, c_code VARCAHR2)
---doing SUM of certain columns based on parameters
For c_d1 IN c_date(d_date) LOOP
d_date := c_d1.dt;
For r_cal IN c_cal(id, date1, code) LOOP
IF date1< TRUNC(ld_sysdate) THEN
sum := sum + r_cal.act_tot;
ELSEIF ....
---- get another value
....
END IF;
END LOOP;
END LOOP;
I placed dbms_output_put_line in both the loops, it prints value in outer loop but never print anything in inner loop. I am not sure what mistake I am making.
Thanks in advance.
Anil