flag of the United Kingdom
URBAN
Mainframe

MySQL: Search & Replace

Date:  Tue, 25th-Jan-2005prevnext

Tags: Databases

I've just finished a little housekeeping on the MySQL database that sits behind this website and I was struck by just how useful MySQL's search-and-replace facility is for this task.

mysql> update table_name set table_field = replace(table_field,'replace_that','with_this');

Wonderful stuff. Now if only the search-and-replace supported Regular Expressions.

You can comment on this entry, or read what others have written (8 comments).


W3C VALIDATE XHTML
W3C VALIDATE CSS