Find & Replace?

2,971 views
Skip to first unread message

Shaw

unread,
Oct 27, 2011, 11:34:15 AM10/27/11
to Sequel Pro
In Sequel Pro, is there any way to do a find & replace in a table? I
have a TEXT column with many rows containing references to XYZ and I
want to replace all of those references with ABC.

Is this something I can do within Sequel Pro, perhaps even with a
query, or will it be something I have to write a script for?

Thanks!

Jakob Egger

unread,
Oct 28, 2011, 11:33:48 AM10/28/11
to seque...@googlegroups.com
Use a custom query:

UPDATE myTable SET field1 = REPLACE(field1, 'XYZ', 'ABC');

If you are not very experienced with SQL, make sure you make a backup before performing potentially dangerous operation where you change every row in a table…

See also:
http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replace

Best regards,
Jakob

> --
> You received this message because you are subscribed to the Google Groups "Sequel Pro" group.
> To post to this group, send email to seque...@googlegroups.com.
> To unsubscribe from this group, send email to sequel-pro+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sequel-pro?hl=en.
>

Reply all
Reply to author
Forward
0 new messages