Dear All,
My team is facing a problem.
They have made a stored procedure which fetches data in to a Cursor and then writes it into a CSV file.
The query has been checked & it is fully optimized.
When executed on sql prompt it fetches data in milliseconds.
The query uses UNION ALL clause & has three such Unions in the cursor.
The ables which are being used have approx 20 Million rows each out of which only 700 are to fetched.
Now when they use the same query on SQL prompt or use it to insert data into a temp table it takes less than a second,but if they use Cursor then it takes 10 to 15 minutes.
As the database used by client is 8i , so bulk collect cannot be used.
Can sombody explin this behaviour of Cursor.
Cheers,
Himanshu
My team is facing a problem.
They have made a stored procedure which fetches data in to a Cursor and then writes it into a CSV file.
The query has been checked & it is fully optimized.
When executed on sql prompt it fetches data in milliseconds.
The query uses UNION ALL clause & has three such Unions in the cursor.
The ables which are being used have approx 20 Million rows each out of which only 700 are to fetched.
Now when they use the same query on SQL prompt or use it to insert data into a temp table it takes less than a second,but if they use Cursor then it takes 10 to 15 minutes.
As the database used by client is 8i , so bulk collect cannot be used.
Can sombody explin this behaviour of Cursor.
Cheers,
Himanshu