SQL command to search and replace characters in mySQL database
Posted on 2010-01-09
Good day everyone,
I am reposting this question with some clarifications and mentioning this in case you're experiencing a déjà vu.
This may be way too simple but it's a case of "not seeing the forest for the trees" with me.
I have a database that stores information in various languages. For some reason some letters with diacriticals got changed. My goal is to do a search all fields in a specific table of the database and replace parts of the content. I will be working in phpMyAdmin to access the database.
What needs to be changed is a specific letter in any part of any word. For instance I like to search for every instance of "Ã³"and replace it with ó -- That letter can be anywhere in a word or sentence.
Also, I don't want to do the search and replace by specific column as for instance "á" can be in Spanish, Slovak, Portuguese and Gaelic, and each language has a column in the table. I don't want to have to run this query individually for each language.
I wonder if you could help me with a SQL command, using this information:
database name: eurost
table name: fields_items
fields/columns (among others): value_catalan value_dutch value_french value_german value_italian value_romanian value_russian value_spanish
Thanks in advance for your help.