I'm looking to replace all occurrences of characters in all columns of all tables in my database.
I got the name of my column like this:
select table_name, column_name from information_schema.columns;
And I would apply an UPDATE REPLACE like this:
update table_name set column_name = replace (column_name, "a", "A");
PS : The replacement of "a" to "A" is just one example, my problem is rather how to link table_name and column_name between my two queries.
I tried with subselect, like:
update (select table_name from information_schema.tables as tables) set (select column_name from columns as information_schema.columns Where table_name = tables) = replace (columns, "a", "A");
But I still get errors when I try. What is the right way to do this?
Thank you in advance.