Does anyone know the SQL statement for replacing a string in the whole of a database.
My database is called DB1 and I want to remove any instance of "Table/".

Many Thanks,

Recommended Answers

All 3 Replies

You can
a) use an interface like Navicat which is capable of global search/replace operations;
b) dump the whole database to a file, replace the string on the file and reload it into the database.
To the best of my knowledge there is no mysql function which does what you wish.

Thanks all. In the end I used the following commands,

=====
UPDATE jos_sh404sef_aliases
SET oldurl = REPLACE(oldurl, "Table/", "")
=====

So you weren't looking for a global search/replace but only for the standard replace function applied to a specific column in a specific table - which is quite another task.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.