Getting "too many rows" error inside a "for" cursor loop
- by Will
I have a trigger that contains two cursors loops, one nested inside the other like this:
FOR outer_rec IN outer_cursor
LOOP
FOR inner_rec IN inner_cursor
LOOP
-- Do some calculations
END LOOP;
END LOOP;
Somewhere in this it is throwing the following error:
ORA-01422: exact fetch returns more than requested number of rows
I've been trying to determine where it's coming from for an hour or so.. but should this error never happen?
Also.. I am assuming the inner loop automatically closes and opens itself again every time the outer loop goes the next record, i hope this is correct.