From prov.26.11@gmail.com@21:1/5 to All on Tue Jul 2 07:13:54 2019
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.
From mikeodba@yahoo.com@21:1/5 to All on Thu Jul 4 01:10:27 2019
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 .