IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Update a column in the table in groups of 100 rows


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Wed Mar 28, 2007 1:40 am
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
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
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

Moderator Emeritus


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

PostPosted: Wed Mar 28, 2007 7:30 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Load new table with Old unload - DB2 DB2 6
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Pulling a fixed number of records fro... DB2 2
No new posts How to load to DB2 with column level ... DB2 6
Search our Forums:

Back to Top