There is a ForgeRock table that contains a name field. In the ForgeRock.name field, you need to replace the substring from ReplaceData.cut with data from the ReplaceData.paste field
CREATE TABLE ForgeRock (`id` int, `name` varchar(77), `description` varchar(55) ); INSERT INTO ForgeRock (`id`, `name`, `description`) VALUES (1, 'OpenIDM', 'Platform for building enterprise provisioning for solutions'), (2, 'OpenAM', 'Full-featured access management'), (3, 'OpenDJ', 'Robust LDAP server for Java'); CREATE TABLE ReplaceData (`id` int, `fieldNaame` varchar(77), `f2` varchar(55), `f2` varchar(55) ); INSERT INTO ReplaceData (`id`, `cut`, `paste`) VALUES (1,,'Open', 'Close'), (2,'IDM', 'xxxxx'); After working out "our" replacement, you should get something like this
(1, 'Closexxxxx', 'Platform for building enterprise provisioning for solutions'), (2, 'CloseAM', 'Full-featured access management'), (3, 'CloseDJ', 'Robust LDAP server for Java');
The first thing that comes to mind:
UPDATE `ForgeRock` d, `ReplaceData` t SET d.`name` = replace(d.`name`, t.`cut`, t.`paste`) Second:
UPDATE `ForgeRock` d, `ReplaceData` t SET d.`name` = replace(d.`name`, t.`cut`, t.`paste`) where d.`name` LIKE CONCAT('%', t.`cut` ,'%'); I do not know further.
ReplaceDatatable,ReplaceData, only Open to Close - Sergey Sereda