Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
DIFFERNCE BETWEEN DECLARING A CURSOR IN DATA/PROCEDURE DIV

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
puppalso

New User


Joined: 07 Dec 2007
Posts: 8
Location: Pune

PostPosted: Wed Jan 02, 2008 2:57 pm    Post subject: DIFFERNCE BETWEEN DECLARING A CURSOR IN DATA/PROCEDURE DIV
Reply with quote

Hi,

Please let me know the differences b/w declaring the cursor in data division Vs declaring the cursor in procedure division. icon_question.gif

Regards,
Soma
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Wed Jan 02, 2008 3:00 pm    Post subject:
Reply with quote

1. If you declare it in data division, you know that the DECLARE .. CURSOR will come before an open/fetch/close.

2. if you declare it in the data division, you don't have simpletons checking the sql code after the declare.
Back to top
View user's profile Send private message
puppalso

New User


Joined: 07 Dec 2007
Posts: 8
Location: Pune

PostPosted: Wed Jan 02, 2008 3:04 pm    Post subject: Reply to: DIFFERNCE BETWEEN DECLARING A CURSOR IN DATA/PROCE
Reply with quote

except those u have mentioned, are there any issues with declaring the cursor in data division .
Back to top
View user's profile Send private message
sharad_shanu

New User


Joined: 03 Oct 2006
Posts: 40

PostPosted: Wed Jan 02, 2008 3:12 pm    Post subject:
Reply with quote

Hi,

DECLARE is just a declaration, not a executable statement. It will give same results in both cases i.e. whether it is defined in Data Division or Procedure Division.

Reference:
• Q26 of http://www.geocities.com/*****/DB2.html



Regards,
Sharad Srivastava
Back to top
View user's profile Send private message
puppalso

New User


Joined: 07 Dec 2007
Posts: 8
Location: Pune

PostPosted: Wed Jan 02, 2008 3:20 pm    Post subject: Reply to: DIFFERNCE BETWEEN DECLARING A CURSOR IN DATA/PROCE
Reply with quote

Hi

Will there be any difference in declaring the cursor in data division while using in case of static sql/dynamic sql
Back to top
View user's profile Send private message
sharad_shanu

New User


Joined: 03 Oct 2006
Posts: 40

PostPosted: Wed Jan 02, 2008 3:33 pm    Post subject:
Reply with quote

Well,

As per my understanding, there should not be any difference.
Only things that matters is that, cursor should be declared before it is getting executed.

Correct me if I am wrong.

Regards,
Sharad Srivastava
Back to top
View user's profile Send private message
puppalso

New User


Joined: 07 Dec 2007
Posts: 8
Location: Pune

PostPosted: Wed Jan 02, 2008 3:48 pm    Post subject: Reply to: DIFFERNCE BETWEEN DECLARING A CURSOR IN DATA/PROCE
Reply with quote

Hi all,

Thanks for the clarification.
As of my knowledge there won't be any difference.
but for clarification i have posted this.

Thanks a lot...
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 Data security erase on RAID device steve-myers All Other Mainframe Topics 0 Sat Jan 13, 2018 6:41 am
No new posts Append the milliseconds to the data s... girishb2 DFSORT/ICETOOL 1 Thu Dec 21, 2017 9:07 pm
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us