View previous topic :: View next topic
|
Author |
Message |
sivasaras
New User
Joined: 29 Sep 2007 Posts: 93 Location: chenna/i-
|
|
|
|
Hi,
while running an stored procedure i am getting -502 error code.
Thanks
siva |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Quoting from Manual
Quote: |
-502 THE CURSOR IDENTIFIED IN AN
OPEN STATEMENT IS ALREADY
OPEN
Explanation:
The application program attempted to execute an
OPEN statement for a cursor that was already open.
System action:
The statement cannot be executed. The cursor was
unchanged (that is, it was not ’reopened’).
Programmer response:
Correct the logic of the application program to ensure
that it does not attempt to execute an OPEN statement
for a cursor that is already open.
SQLSTATE:
24502 |
|
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
|
|
I am sure Siva must have Googled or checked the manual for this.
If you have a nested Stored Procedure then you might have to check everything and make sure the same cursor is not opened twice unless it is previously closed in the same Unit of Work. |
|
Back to top |
|
|
sivasaras
New User
Joined: 29 Sep 2007 Posts: 93 Location: chenna/i-
|
|
|
|
hi,
Thaniks for the clarification. previously without closing the cursor itself the program worked, why suddeenly it is not working and getting -502 sqlcode.
that is the confusion for me
thsnks
siva |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Probably someone might have added a WITH HOLD and commiting it |
|
Back to top |
|
|
sivasaras
New User
Joined: 29 Sep 2007 Posts: 93 Location: chenna/i-
|
|
|
|
i checked it is having WiTH RETURN for only and it is not necessary to close the cursor for online SPs which is calling from the Front end. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
|
|
Yes, right. It is not necessary to close the cursor. it looks to me a logical problem with the code, you might have to see when does OPEN CURSOR executes and how many times.
Quote: |
Thaniks for the clarification. previously without closing the cursor itself the program worked, why suddeenly it is not working and getting -502 sqlcode. |
Have you changed anything in the program pertaining to CURSOR? |
|
Back to top |
|
|
sivasaras
New User
Joined: 29 Sep 2007 Posts: 93 Location: chenna/i-
|
|
|
|
yes, i closed the cursor that shall it is working fine now with no issues |
|
Back to top |
|
|
|