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
 

 

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: 6966
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 Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am


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