View previous topic :: View next topic |
Author |
Message |
byhalia Beginner
Joined: 30 Aug 2006 Posts: 9 Topics: 3
|
Posted: Wed Oct 18, 2006 3:10 pm Post subject: How to update part of varchar column |
|
|
Before letting this Q here i have checked the forum and found this
http://www.mvsforums.com/helpboards/viewtopic.php?t=6378&highlight=update
it did not worked as the field i am updating is varchar of length 256.
i need to put a constant of XXX in the first three bytes no matter whatever is in rest 4 to 256 bytes.
Thanks
Byhalia |
|
Back to top |
|
 |
byhalia Beginner
Joined: 30 Aug 2006 Posts: 9 Topics: 3
|
Posted: Wed Oct 18, 2006 3:11 pm Post subject: |
|
|
can this happen in a single query. any number of queries how should i do it. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
|
Posted: Wed Oct 18, 2006 4:00 pm Post subject: |
|
|
byhalia,
Try this
Code: |
UPDATE TABLE
SET your_varchar_col = 'XXX' CONCAT SUBSTR(your_varchar_col,4,253);
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
byhalia Beginner
Joined: 30 Aug 2006 Posts: 9 Topics: 3
|
Posted: Fri Oct 20, 2006 5:39 am Post subject: Thanks |
|
|
it is working. |
|
Back to top |
|
 |
|
|