View previous topic :: View next topic
|
Author |
Message |
sureshbabu.jv
New User
Joined: 11 Apr 2006 Posts: 41 Location: Chennai
|
|
|
|
Hi,
I have a 50 CHAR Column. Want to update only last 10 Char. Is it possible to do that? If please provide me a Update query for reference?
Thank you! |
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
What do you want to update it with ?
try something like
UPDATE TABLE A SET COL = (SELECT SUBSTR(COL,1,40)|| '10 CHARS'
FROM TABLE WHERE COL = A.COL )
be careful if the column is an index ..you might encounter -803 ... |
|
Back to top |
|
|
sureshbabu.jv
New User
Joined: 11 Apr 2006 Posts: 41 Location: Chennai
|
|
|
|
Hi Ashimer,
I want to update last 10 char with like EMAR080609 for all the rows of 50 char column.
Thanks,
Suresh |
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
Code: |
UPDATE TABLE A SET COL = (SELECT SUBSTR(COL,1,40)|| 'EMAR080609'
FROM TABLE WHERE COL = A.COL )
|
|
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Code: |
UPDATE TABLE SET COL = SUBSTR(COL,1,40) || 'EMAR080609' |
|
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
Right Craq ..I missed a simple one ... |
|
Back to top |
|
|
|