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
 
Update a column in the table in groups of 100 rows

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

New User


Joined: 10 Mar 2006
Posts: 3
Location: MUMBAI

PostPosted: Tue Mar 27, 2007 10:13 pm    Post subject: Update a column in the table in groups of 100 rows
Reply with quote

Hi all,

Suppose i have a table containing 1000 rows and i want to update a column in the table in groups of 100 rows i.e, fetch first 100 rows, update
the column for the 100 rows,fetch the next 100 rows, update the column for these 100 rows and so on until 1000 rows are reached.

How can we do this in the previous version of DB2 and the current DB2V8
version ?

Thanks.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Mar 28, 2007 1:40 am    Post subject:
Reply with quote

Hello,

Please explain more fully and more clearly.

What are "groups of 100"? Do you want separate processes for each group of 100 or do you somehow want to "internally group" them? What is different or special about each group? Might you be talking about when/how to take checkpoints?

If you choose to declare a cursor and fetch/update rows until you reach 100, you should be able to do it in "both" versions of DB2.
Back to top
View user's profile Send private message
Harish-Ramakrishnan

New User


Joined: 10 Mar 2006
Posts: 3
Location: MUMBAI

PostPosted: Wed Mar 28, 2007 9:43 am    Post subject:
Reply with quote

Hi,

By groups of 100 i mean update the column for the first 100 rows,fetch the next 100 rows and update,then the third 100 rows and so on. Looking for different ways of doing it in the previuos and current versions of DB2.

Thanks.
Back to top
View user's profile Send private message
vini_srcna

Active User


Joined: 26 May 2005
Posts: 178
Location: Copenhagen, Denmark

PostPosted: Wed Mar 28, 2007 12:55 pm    Post subject:
Reply with quote

May be you have think of doing this via some program.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Mar 28, 2007 7:30 pm    Post subject:
Reply with quote

Hello,

You repeated what your original post asked. . . . I believe we understand the read/update 100 at a time.

What is the requirement to do this? Is this a restart/recovery issue?

Why does it matter which version of DB2?

If you provide a better requirement definition, we can offer better replies.

If all you want to do is what you initilly asked, please use the solution suggested above. It will work in "both" versions of DB2.
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 Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts Conditional highlighting of rows in I... packerm CLIST & REXX 2 Thu Sep 21, 2017 6:50 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm

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