View previous topic :: View next topic
|
Author |
Message |
janmejay Warnings : 1 New User
Joined: 22 Jun 2007 Posts: 85 Location: bangalore
|
|
|
|
Hello
i have a db2 table which contains a phone_no field.
lets example
phone_no
___________
5223432
5234567
5244568
5367902
now i need to update the phone_no field.the starting no. 5 should be replaced by 6.
how to update at a single time , so that all phone nos starting with 5 should be replaced by 6. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Is there some reason this is posted in the idms part of the forum?
You need to provide more info. . .
How is phone_no defined? If it the primary key? Is it a unique key? |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Code: |
UPDATE yourtablename
SET phone_no = phone_no + 1000000
WHERE phone_no BETWEEN 5000000 AND 5999999;
|
If it is not unique or primary key.. above will work for you. |
|
Back to top |
|
|
santosh100678
New User
Joined: 21 Sep 2009 Posts: 55 Location: Kolkatta
|
|
|
|
Hi
I need sample jcl throu which i upload db2 table using input as a file
1.Input file I have 2 generate thru cobol pgogram
2. first create input file thru cobol
3. submit jcl usiing above input file.
4. if some column in db2 table is varchar then during upload process from file to db2 table any change required . |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
Sambhaji wrote: |
Code: |
UPDATE yourtablename
SET phone_no = phone_no + 1000000
WHERE phone_no BETWEEN 5000000 AND 5999999;
|
If it is not unique or primary key.. above will work for you. |
Why shouldn't it be primary key ? |
|
Back to top |
|
|
|