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

Declaration of CURSOR


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

New User


Joined: 16 Dec 2004
Posts: 44
Location: Hyderabad

PostPosted: Fri Jan 20, 2006 2:24 am
Reply with quote

Hi,

Why do we declare the cursors only in working storage section. Though we can declare them either in working storage section or in procedure division, why would we go for working storage section only?


Thank you,
Brahma
Back to top
View user's profile Send private message
Lkmi

New User


Joined: 04 Mar 2005
Posts: 53
Location: Newyork

PostPosted: Fri Jan 20, 2006 3:25 am
Reply with quote

there is no hard and fast rule about the declaration. My shop uses declarations in the procedure division too..
Back to top
View user's profile Send private message
manjinder

New User


Joined: 04 Dec 2005
Posts: 45
Location: pune

PostPosted: Fri Jan 20, 2006 9:28 am
Reply with quote

as we know declaration of cursor is non executable statements ,so we can give it in working sto section for just checking it and we can also declare it in P.D.

regard..
manjinder
Back to top
View user's profile Send private message
prabs2006

Active User


Joined: 12 Jan 2006
Posts: 103

PostPosted: Fri Jan 20, 2006 11:14 am
Reply with quote

Hi Friends,

I believe there should be some diff when declaring the Cursor in W/S section against the Procedure div section.It would be nice if someone comes up with a definite answer.Please rectify me if am wrong.

Thanks & Regards
Prabs
Back to top
View user's profile Send private message
vikasc4

New User


Joined: 11 Dec 2005
Posts: 32

PostPosted: Fri Jan 20, 2006 12:04 pm
Reply with quote

Hi prabs,

As far as the declaration is concerned there is no difference in declaring the cursor in W/S or P.D. You can declare it any where and it will not effect the running or compiling of program. As cursor will contain some data (Row of a table) so it is a normal practice to declare it in W/S.


Thanks & Regards
Vikas
Back to top
View user's profile Send private message
prabs2006

Active User


Joined: 12 Jan 2006
Posts: 103

PostPosted: Fri Jan 20, 2006 12:20 pm
Reply with quote

Thats fine..Thanks
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 Is SQLCODE -811 possible while fetchi... DB2 1
No new posts Restart logic by using cursor name in... DB2 1
No new posts Seeking Resolution for SQKCODE -991 o... DB2 2
No new posts Multiple rows within Cursor when Coun... DB2 14
No new posts Dynamic cursor name in Cobol program COBOL Programming 1
Search our Forums:

Back to Top