Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

db2 error code -502

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
sivasaras

New User


Joined: 29 Sep 2007
Posts: 90
Location: chenna/i-

PostPosted: Thu Apr 10, 2014 6:52 pm    Post subject: db2 error code -502
Reply with quote

Hi,

while running an stored procedure i am getting -502 error code.

Thanks
siva
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Thu Apr 10, 2014 6:59 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Fri Apr 11, 2014 5:56 am    Post subject:
Reply with quote

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
View user's profile Send private message
sivasaras

New User


Joined: 29 Sep 2007
Posts: 90
Location: chenna/i-

PostPosted: Fri Apr 11, 2014 2:58 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Fri Apr 11, 2014 5:05 pm    Post subject:
Reply with quote

Probably someone might have added a WITH HOLD and commiting it
Back to top
View user's profile Send private message
sivasaras

New User


Joined: 29 Sep 2007
Posts: 90
Location: chenna/i-

PostPosted: Fri Apr 11, 2014 5:33 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Wed Apr 16, 2014 4:11 am    Post subject:
Reply with quote

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
View user's profile Send private message
sivasaras

New User


Joined: 29 Sep 2007
Posts: 90
Location: chenna/i-

PostPosted: Fri Apr 18, 2014 6:54 pm    Post subject:
Reply with quote

yes, i closed the cursor that shall it is working fine now with no issues
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts S922 Error yuvan ABENDS & Debugging 3 Fri Dec 02, 2016 6:58 pm
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm
No new posts Invoke Webservice Fails with DFHPI100... divated CICS 2 Thu Nov 24, 2016 5:57 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us