Database Administration (MOSC)

MOSC Banner

Fetching Cursor Is Very Slow

edited Feb 5, 2009 11:21PM in Database Administration (MOSC) 5 commentsAnswered

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;

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center