View previous topic :: View next topic
|
Author |
Message |
natinuk
New User
Joined: 23 Nov 2006 Posts: 22 Location: India
|
|
|
|
I am need to update one of the primary key data.
Can we update the key field ADDR as mentioned below,
Here is the query,
UPDATE NAT_TABLE
SET ADDR = 'P'
WHERE ACCOUNT = '2222222'
AND ADDR = 'S'
Thanks in Advance |
|
Back to top |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Hi natinuk,
U can update the primary key values. But make sure that the latest updated value should not be same with the existing values, which is nothing but primary key violation. |
|
Back to top |
|
|
prasadvrk
Active User
Joined: 31 May 2006 Posts: 200 Location: Netherlands
|
|
|
|
Is the field ADDR part of the primary key |
|
Back to top |
|
|
prasadvrk
Active User
Joined: 31 May 2006 Posts: 200 Location: Netherlands
|
|
|
|
Sorry I did not pay attension to your sentence 'Can we update the key field ADDR as mentioned below,'
As far as I know changing the value of any primary key would result in a new row. Primary key is the field is the basis for selection of rows, so how can you change the value for the same. If you change it would be trated as a new row but can not replace the old one. |
|
Back to top |
|
|
|