Gossamer Forum
Home : General : Databases and SQL :

find/ replace with a difference

Quote Reply
find/ replace with a difference
Hi,

I have been searching through the archives trying to find an answer to my problem. SO far I have only found a partial one so I am hoping someone can help me.

On importing data into my database I have found that there are some special characters that I need to replace in almost every field. for instance ' appears as .

What I am hoping to do is find or create a function that can look for that character in all of the fields in my database and replace it with '.

I have looked at this method "UPDATE PROPERTY SET PROPERTY_DESC = REPLACE(PROPERTY_DESC, '', '\'')" but that would require one line of code for every field. and in a database with 35 tables that would take a very long time.

So, I am wondering if anyone has come accross a way of telling mysql to find/replace a character that occurs through out the entire database, all at once.

Thanks in advance.

Kev