Mohamed sameer
Mohamed sameer

Reputation: 1

Parameterized cursor within a cursor loop?

  1. I have a parameterized cursor "cur_lovs(parm1, parm2, parm3)"
  2. I want to loop and inside the loop, I wanna use the same cursor "cur_lovs(parm1, parm2, valOfMainLoop)" with the values getting from main loop.

If I try this I am getting the below error:

ORA-06511: PL/SQL: cursor already open

is there any way to do this?

Upvotes: 0

Views: 94

Answers (1)

Tilen
Tilen

Reputation: 531

The error is self explanatory. You can not reuse the cursor whilst it is still open, but you can always close it and open it back up.

If you want to use a cursor within a cursor loop, you'll need another cursor.

Upvotes: 1

Related Questions