Fetching Cursor Is Very Slow
The problem I'm facing is when fetching a cursor is very slow. For e.g. below, when I debug the procedure until line 15 (FETCH test_cur INTO ...), it's stuck for a while about 4 or 5 min, but if I run through, it's stuck though I leave the executing 2 or 3 hours...
Does anyone know why when the excuting reaches statement FETCH test_cur INTO ... (line 15), it stuck there? I'm using Oracle 11g.
1 ...
2 PROCEDURE xxx
3 (...)
4 IS
5 CURSOR test_cur IS
6 SELECT ...
7
8 BEGIN
9 ...
10 IF NOT test_cur%ISOPEN THEN
11 OPEN test_cur;
12 END IF;
13
14 LOOP
15 FETCH test_cur INTO ...
16
17 EXIT WHEN test_cur%NOTFOUND;
0