|
View previous topic :: View next topic
|
| Author |
Message |
Harish-Ramakrishnan
New User
Joined: 10 Mar 2006 Posts: 3 Location: MUMBAI
|
|
|
|
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 |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
Harish-Ramakrishnan
New User
Joined: 10 Mar 2006 Posts: 3 Location: MUMBAI
|
|
|
|
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 |
|
 |
vini_srcna
Active User

Joined: 26 May 2005 Posts: 178 Location: Copenhagen, Denmark
|
|
|
|
| May be you have think of doing this via some program. |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
|
|