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
 

 

Declaration of CURSOR

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Declaration of CURSOR
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    Post subject:
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    Post subject: Re: Declaration of CURSOR
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    Post subject:
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    Post subject:
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    Post subject:
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    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 Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am
No new posts DB2 Stored Procedure - Dynamic SQL - ... GuyC DB2 2 Wed Feb 17, 2016 5:10 pm
No new posts ISREDIT - Position Cursor on the Comm... Tarique Anwer TSO/ISPF 5 Wed Feb 03, 2016 12:44 pm
No new posts Declaration of varchar in cobol s.saranya srinivasan COBOL Programming 6 Fri Sep 25, 2015 11:43 am


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