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: 6968
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 Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

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