Reputation: 11
I'm trying to find instances of a "|" (pipe) character in a field containing serialized data and replace it with a " ' " character (apostrophe).
I've tried this:
UPDATE postmeta SET meta_value = Replace(meta_value, '|', ''');
And this...
UPDATE postmeta SET meta_value = Replace(meta_value, '|', '"'"');
And this...
UPDATE postmeta SET meta_value = Replace(meta_value, '|', ''');
Also, this...
UPDATE postmeta SET meta_value = Replace(meta_value, '|', '\'');
Each result in errors.
Upvotes: 1
Views: 92
Reputation: 4491
Try this :
UPDATE postmeta SET meta_value = Replace(meta_value, '|', "'");
Upvotes: 0
Reputation: 3784
http://dev.mysql.com/doc/refman/5.6/en/string-literals.html#character-escape-sequences
UPDATE postmeta SET meta_value = Replace(meta_value, '|', '''');
Upvotes: 1