Prardhan N
asked on
SQL0501N The cursor specified in a FETCH statement or CLOSE statement is not open or a cursor variable in a cursor scalar function reference is not open. SQLSTATE=24501
SQL0501N The cursor specified in a FETCH statement or CLOSE statement is not
open or a cursor variable in a cursor scalar function reference is not open.
SQLSTATE=24501
I am facing the above error while executing a Db2 procedure.
Can you please help me to solve this.
open or a cursor variable in a cursor scalar function reference is not open.
SQLSTATE=24501
I am facing the above error while executing a Db2 procedure.
Can you please help me to solve this.
From here :
ASKER
i could see this help from db2 ? SQL0501N
Can you pls elaborate more?
i am attaching the file with code.
Can you please guide me more.
Thanks a lot for your help
Can you pls elaborate more?
i am attaching the file with code.
Can you please guide me more.
Thanks a lot for your help
No code attachment.
Usually this just means that you tried to FETCH or CLOSE a cursor that isn't open. Usually this is due to a defect in your code. Maybe the OPEN failed and you didn't detect it, for example.
ASKER
Yes, i have changed my for cursor statements to while cursor and error is not throwing now.
but i need to know how to use the data studio to trace the particular order value (i mean for a particular data value) for step by step
tracing of my procedure code.
but i need to know how to use the data studio to trace the particular order value (i mean for a particular data value) for step by step
tracing of my procedure code.
Here is a great tutorial on debugging IBM i DB2 stored stored procedures in IBM Data Studio:
https://www.ibm.com/developerworks/ibmi/library/i-debugger-db2-i/index.html
https://www.ibm.com/developerworks/ibmi/library/i-debugger-db2-i/index.html
ASKER
I have the requirement of dynamic cursor to store a single column with 2 to 3 record values and iterate with in that single column to process.
I have to declare the dynamic cursor with in a while loop. Please help me with respect to this.
Do i need to use refcursor?
I have to declare the dynamic cursor with in a while loop. Please help me with respect to this.
Do i need to use refcursor?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The current transaction has been rolled back because of a deadlock or timeout. Reason code "68".. SQLCODE=-911, SQLSTATE=40001, DRIVER=4.18.60
The current transaction has been rolled back because of a deadlock or timeout. Reason code "68".. SQLCODE=-911, SQLSTATE=40001, DRIVER=4.18.60
facing this error while compiling the Procedure.
I have cleared the locks. but still same issue while compilation. Is this happening while prepare
The current transaction has been rolled back because of a deadlock or timeout. Reason code "68".. SQLCODE=-911, SQLSTATE=40001, DRIVER=4.18.60
facing this error while compiling the Procedure.
I have cleared the locks. but still same issue while compilation. Is this happening while prepare
Can you post the SQL that you're trying to compile?
By my count, this is the third different question posted in this single thread. Please close this question and open a new one - you may get more experts to respond.
ASKER
Thanks for all your help with this regard. Appreciating your efforts.