IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

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


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Amolondhe007
Warnings : 1

New User


Joined: 16 Apr 2007
Posts: 49
Location: Pune

PostPosted: Fri Jan 08, 2010 4:39 pm
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
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
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: 49
Location: Pune

PostPosted: Fri Jan 08, 2010 4:48 pm
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
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: 71
Location: USA, CA.

PostPosted: Sat Jan 09, 2010 2:33 am
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: 49
Location: Pune

PostPosted: Thu Jan 14, 2010 3:28 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top