Dynamic Cursor is not fetching to the next record value

Hi All


I have used dynamic cursors in my code. I also have used elseif ladder to avoid following error.

The program attempted to execute an OPEN statement for an open cursor.

I could be able to resolve the above error with elseif ladder but the following statement in my code is not fetching any new record
into V_WC8PAY_ID when i checked in line by line debugging.

fetch c10 into V_WC8PAY_ID;

I could not understand why dynamic cursor c10 is not working.

Please guide me.
Prardhan NAsked:
Who is Participating?
Kent OlsenConnect With a Mentor Data Warehouse Architect / DBACommented:
Hi sridhar,

Some mostly minor things....

- It looks like cursor c10 isn't being closed after you loop through the data for the firs value of V_PPCPAYINST_ID.
- You can use a single EOF flag to manage your loops.
- The test for FLAG around the opening of cursor C4 is unnecessary.

I've removed all of the commented code (so it was easier for me to read) and made the changes noted above.  See attachment.

Prardhan NAuthor Commented:
Thanks for your kind help.
Appreciating your help.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.