MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Declaring a Cursor

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
sreen
Beginner


Joined: 01 Apr 2003
Posts: 2
Topics: 1

PostPosted: Fri May 02, 2003 9:50 am    Post subject: Declaring a Cursor Reply with quote

I need to read a table which contains 5 million records sequentially ( cobol - db2 batch program ) from first record until the end of the table.

This is the logic I have in place.

move spaces to index1

declare curosr cursor1 with hold for
select * from table1 where column1 > :index1

I suspect there is a better way of doig this but ...

Any ideas or suggesstions will be helpful.

Thank You in advance,
Sreen
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
SureshKumar
Intermediate


Joined: 23 Jan 2003
Posts: 211
Topics: 21

PostPosted: Fri May 02, 2003 10:49 am    Post subject: Reply with quote

If you are not performing any inserts or updates and no commit logic, you may exclude withhold, remove the where clause and let DB2 do a tablespace scan which is a better option under these circumstances. If no updates, and logically feeasible you may add WITH UR.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Fri May 02, 2003 12:37 pm    Post subject: Reply with quote

Sreen,

I would suggest unloading the db2 table and read the flat file via a cobol program which saves a lot of times as well as resources.

Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group