473,414 Members | 1,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

mysql replace

Hi

I have a large database with text strings.

What is the quickest way to replace each ['] with a ['] throughout
the database fields while leaving everything else intact?

ex

.... I'm a monkey ...

becomes

.... I'm a monkey ...

etc

Thanks!
Jul 20 '05 #1
2 2058
<snip>What is the quickest way to replace each ['] with a [']</snip>
<off topic>
Maybe you also want to look at this place:
http://www.djwice.com/hulpjes/SpecialCharacters.html

For other characters you want to replace
</off topic>

Sorry, can't help you with the MySQL thing, I also don't know what the
fastest way is to replace all.

Ciao,
Wouter
Jul 20 '05 #2
Marcus wrote:
What is the quickest way to replace each ['] with a ['] throughout
the database fields while leaving everything else intact?


I'd try this:

UPDATE myTable SET
textField1 = REPLACE(textField1, '\'', '''),
textField2 = REPLACE(textField2, '\'', '''),
textField3 = REPLACE(textField3, '\'', ''');

You probably have to repeat this for every table that contains text fields.

See http://dev.mysql.com/doc/mysql/en/String_functions.html for more
info on REPLACE() and many other string functions built into MySQL.

MySQL has a pretty good set of builtin functions, and familiarizing
yourself with them is a worthwhile thing to do if you use MySQL regularly.

Regards,
Bill K.
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Westcoast Sheri | last post by:
To keep track of how many fruits my visitors buy, I use a mySQL database (2 columns: "fruit" and "quantity")....so can we make these following mySQL queries work somehow? (visitor buys 5...
4
by: Angelos | last post by:
Hello, First of all sorry if this is not the correct newsgroup for this question, but I am using PHP with MYSQL and someone here could have an answer and the experience. I have the a table...
4
by: mikey | last post by:
Hi all, I'm having great problems trying to install the latest MySQl RPM package onto my Red Hat Linux OS. There is already MySQL v 3.0 pre-installed with the RH Linux distribution disk but I...
10
by: John Smith | last post by:
I know that uploading an image to a database has been covered, oh, about 3 trillion times. However, I haven't found anything covering uploading to a MySQL database with .net. Please don't...
2
by: trihanhcie | last post by:
I m currently working on a Unix server with a fedora 3 as an os My current version of mysql is 3.23.58. I'd like to upgrade the version to 5.0.18. After downloading from MYSQL.COM the package on...
1
by: manish deshpande | last post by:
Hi, When i'm installing MySQL-server-standard-5.0.24a-0.rhel3.i386.rpm by the following command: rpm -i MySQL-server-standard-5.0.24a-0.rhel3.i386.rpm the following error is being shown: ...
6
by: viki1967 | last post by:
Not register double record in the DB MySQL I have developed a simple procedure asp to upload files csv and record data in the table mysql database. This procedure not register double record...
1
ssnaik84
by: ssnaik84 | last post by:
Hi Guys, Last year I got a chance to work with R&D team, which was working on DB scripts conversion.. Though there is migration tool available, it converts only tables and constraints.. Rest of...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.