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
 

 

Wwhat happens if we dont close cursor in db2-cobol pgm?

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

New User


Joined: 16 Apr 2007
Posts: 50
Location: Pune

PostPosted: Fri Jan 08, 2010 4:39 pm    Post subject: Wwhat happens if we dont close cursor in db2-cobol pgm?
Reply with quote

What happens if we dont close cursor in db2-cobol pgm?
And after that again i'm trying to open Cursor.
Back to top
View user's profile Send private message

Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Jan 08, 2010 4:44 pm    Post subject:
Reply with quote

Why don't you try it??? And let people here know if anything you are not clear with?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jan 08, 2010 4:47 pm    Post subject:
Reply with quote

Quote:
What happens if we dont close cursor in db2-cobol pgm?


it will be closed by db2 at end of task.

Quote:
And after that again i'm trying to open Cursor.

if you are trying to open an 'open' cursor, you will receive an error from db2.

answers to both questions can be found in
Back to top
View user's profile Send private message
Amolondhe007
Warnings : 1

New User


Joined: 16 Apr 2007
Posts: 50
Location: Pune

PostPosted: Fri Jan 08, 2010 4:48 pm    Post subject: Reply to: Wwhat happens if we dont close cursor in db2-cobol
Reply with quote

Sambhaji,

I think there will be no know but if you are trying to open it again at that time it will error.
I think it will show 502 error..Let me correct if i'm not wrong.

Thanks,
Amol
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Jan 08, 2010 5:04 pm    Post subject:
Reply with quote

Quote:

I think there will be no know but if you are trying to open it again at that time it will error.
I think it will show 502 error..Let me correct if i'm not wrong.

As dick has already mentioned cursor will be closed by db2 at end of task even if you dont close explicitly in your cobol-db2 program.
Back to top
View user's profile Send private message
Keanehelp

New User


Joined: 27 May 2008
Posts: 70
Location: USA, CA.

PostPosted: Sat Jan 09, 2010 2:33 am    Post subject:
Reply with quote

In case you try to open a cursor without closing that cursor you will get an error as ' trying to open a cursor which is already open'.
SQLCODE = -502.
Back to top
View user's profile Send private message
Amolondhe007
Warnings : 1

New User


Joined: 16 Apr 2007
Posts: 50
Location: Pune

PostPosted: Thu Jan 14, 2010 3:28 pm    Post subject:
Reply with quote

Thanks to everyone.....
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 Getting -504 Cursor Name GTT-ARTS-CUR... Robin Sulsona DB2 2 Fri Mar 17, 2017 1:43 am
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Release of Adabas Cursor mohitsethi All Other Mainframe Topics 1 Mon Feb 06, 2017 8:36 pm


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