Hi,
There is a performance issue when accessing a cursor with a for loop within a procedure.
If we execute the query directly in the database, it will run within seconds. But if we access it via a FOR loop, it will hang at the FOR statement for around 30 minutes in the first iteration. Example is given below. This query will fetch around 35500 records from database.
Eg:
Procedure XXXX
Cursor report_query_ IS
Select YYYY From ZZZZ;
Begin
For row_ in report_query_ LOOP (execution hangs at this statement)
--do something;
END LOOP;
END XXXX;
Any idea how to investigate this? Why there is a difference when running the query directly and via a for loop?
Best Regards,
Nisansala