View previous topic :: View next topic
|
Author |
Message |
kalaignar_S Warnings : 1 New User
Joined: 06 Jan 2006 Posts: 21
|
|
|
|
Hi.
I have a cobol-db2 program, that contains a cursor.
I didnt closed that cursor (i have open & fetch stmt in the pgm).
Let me know whether it will give any error.
Thanks
Kalaignar |
|
Back to top |
|
|
anamikak
New User
Joined: 10 May 2006 Posts: 64 Location: Singapore
|
|
|
|
SQLCODE -501 Cursor not open on FETCH |
|
Back to top |
|
|
shreevamsi
Active User
Joined: 23 Feb 2006 Posts: 305 Location: Hyderabad,India
|
|
|
|
hi..
It depends on your Program Logic.
If there is single fetch in your Pgm..there shouldn't be any poblem.
else may abend.
~Vamsi |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hey,
I dont think u will get any error..since u r opening the cursor & fetching the record...Cursor automatically closed after execution of ur program complete. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Hello,
I agree with Ekta: when terminating, program closes cursor without error.
It does not matter how many FETCHes you did. |
|
Back to top |
|
|
anamikak
New User
Joined: 10 May 2006 Posts: 64 Location: Singapore
|
|
|
|
Yes, A cursor always closes when a UOW ends. But I would say that it is good practice to close cursor in your Db2 programs when result set is not needed. This would increase the performance. |
|
Back to top |
|
|
|