Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.

Closed Cursor SQL -501

Skip to first unread message

Jul 2, 2019, 10:13:56 AM7/2/19
I got a -501 error indicating the cursor was closed during a fetch. I know for a fact that the cursor was opened properly and that it was not intentionally closed. I do no database updates either, so I know I don't need a WITH HOLD on it.

I did trap a -305 error (null value returned) on a separate SQL SELECT statement prior to the fetch. Is it possible that this closed the cursor? I know some SQL return codes will close a cursor, but I can't find a definitive list anywhere.

Thanks in advance

Jul 4, 2019, 4:10:29 AM7/4/19
Not enough detail in your question to give an answer. No code and no platform/environment/version/programming-language details etc.

Do some debugging. If the problem is reproducible that will be easier. If the -501 does not repeat on demand, use code inspection , check for uncaught or ignored exceptions, check database diagnostics, check all code paths .
0 new messages