Archive for March, 2010

Search and Replace

March 1, 2010 Leave a comment

Scenario: To update string value of a table column based on search and replace.

update table_name
set column_name = replace(column_name, ‘oldname’, ‘newname’)
where column_name like ‘%oldname%’;

table_name Рname of the table, column_name Рname of the column,  oldname Рname to be replaced, newname Рreplacement string

Categories: Oracle, SQL Tags: ,