replace command in sql [message #78317] |
Wed, 13 February 2002 03:42 |
Ben
Messages: 48 Registered: January 2000
|
Member |
|
|
I am trying to update only 1 character in a column
Via a trigger so for example: 3compare I would like to replace the 3 with 4 so it will now be 4compare.
Can somebody tell me what syntax I have to use for the update? with the select is no problem :select replace(column name,'3','4') from table name how can i do it for update? Thanks in advance.
|
|
|
|
Re: replace command in sql [message #80515 is a reply to message #78317] |
Sat, 05 October 2002 18:29 |
Zamir
Messages: 1 Registered: October 2002
|
Junior Member |
|
|
This was really helpful. Here is an actual command if you want to replace text value in a field.
update table1
set table1.field1 =
replace ( table1.field1, 'find and replace this' , 'with this')
from table1, table2
where table1.field2 = table2.field2
and table1.field1 like '%find and replace this%'
|
|
|