Cursor remain open or close when control returns to calling program

3 posts / 0 new
Last post
Anonymous
Cursor remain open or close when control returns to calling program

 

Lets say there is a cobol program A, which calls another cobol DB2 program
B.
 
There is a cursor in program B, we do open it, fetch it but do not close it in 
the called program.
 
Now when the control returns back to A, would the cursor be closed, since the control
is no more with the program which is using the cursor or would it remain open.
 
Any thoughts?
 
- kapil
Anonymous
Hi Kapil Until the

Hi Kapil

Until the explicit Db2 close cursor statement or commit/rollback statements or Cobol cancel statement is not written cursor will not close.

I am not sure about Cobol cancel statement but I thing that also closes open cursors and commits everything that is done by called module.

Deepak U.

Offline
Joined: 12/26/2011 - 06:34
cursor open or closed

What is the "real" question here?

How will it matter to pgmA if a cursor opened by pgmB is closed or not? PgmA cannot "continue" Fetching from the pgmB cursor. . .

If we understand what you want to attempt/address, someone may have a suggestion.

Log in or register to post comments
Sponsored Listing