| ORA-01001: invalid cursor [message #539041] |
Wed, 11 January 2012 01:10  |
 |
ninan
Messages: 163 Registered: June 2011 Location: Noida
|
Senior Member |
|
|
We have a package procedure called from SSRS , which returns a REFCURSOR to the SSRS.
Sometimes it throws the error. The user Refresh the SSRS session and again run the query , the error does not happen
Following is the error number
ORA-01001: invalid cursor
We have not used any static cursor , so this is not happening because we have opened a cursor and not closed it.
The Cursor used is REF CURSOR and the output parameter is declared as
---------------
p_ref_cursor OUT SYS_REFCURSOR
----------
The Procedure returns the Select query in the REF CURSOR.
|
|
|
|
|
|
|
|
|
|
| Re: ORA-01001: invalid cursor [message #539046 is a reply to message #539043] |
Wed, 11 January 2012 01:56   |
flyboy
Messages: 1903 Registered: November 2006
|
Senior Member |
|
|
What is "dummy value"? Probably not correctly opened cursor, as FETCHing from it (non-open cursor) causes the exception you complain.
www.orafaq.com/wiki/ORA-01001
Anyway, you should really remove WHEN OTHERS clause as Michel suggested. With this question you proved, that your exception "handling" is not better than the standard Oracle one - you just hid the error (so you cannot spot it at all) and propagated it further (hence ORA-01001). Would it not be better to let the exception (whatever it caused it) raise instead? After investigating it, you may be able to eliminate its cause.
|
|
|
|
|
|
|
|
| Re: ORA-01001: invalid cursor [message #539088 is a reply to message #539076] |
Wed, 11 January 2012 04:48  |
flyboy
Messages: 1903 Registered: November 2006
|
Senior Member |
|
|
As you did not post where exactly that error was raised, it is hard to suggest anything more. So, I will only concentrate on those pieces of code, which you posted.
The INSERT statement is most probably wrong - it will be rolled back if anything wrong happens in that transaction.
It seems you like scratching your left ear with your right hand (log errors somewhere and dig it afterward), but I consider it to be less comfortable than simple letting the exception raise.
Good luck in your attempts with finding out errors which you hid beforehand.
|
|
|
|