Hi Ben,


I received this error when running the following



*Error: 1175 SQLSTATE: HY000 (ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE)

Message: You are using safe update mode and you tried to update a table
without a WHERE that uses a KEY column



UPDATE Products SET P_Name = REPLACE(P_Name,'FISH-FRY MINNOW®','FISH-FRY
MINNOW™') WHERE P_Name LIKE '%FISH-FRY MINNOW®%';



The following worked and displayed the proper replacements in seven rows,
but I need to move this from just a display to an UPDATE



SELECT REPLACE(P_Name,'FISH-FRY MINNOW®','FISH-FRY MINNOW™') FROM
Products WHERE P_Name LIKE '%FISH-FRY MINNOW®%';



I tried numerous variations of the UPDATE sql, but with no luck. Any ideas
would be appreciated.



Thanks



Steve

  _____

From: Ben Johansen [mailto:b...@webspinr.com]
Sent: Tuesday, February 08, 2011 4:17 PM
To: Witango-Talk@witango.com
Subject: Re: Witango-Talk: Looking for a little SQL help (OT)



try replace()



http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replac
e
<http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_repla
ce>



UPDATE Category SET Cat_Name = replace(Cat_Name,'&reg;','&#8482;') WHERE
Cat_Name LIKE '%&reg;%';



On Feb 8, 2011, at 1:55 PM, Fogelson, Steve wrote:





Hi,



Database is MySQL. Having a brain fart today. I want to update all
occurrences of &reg; to &#8482; in a field, but leave the rest of the field
intact.



I believe this would set the filed to &#8482;



UPDATE Category SET Cat_Name = '&#8482;' WHERE Cat_Name LIKE '%&reg;%';



Thanks



Steve Fogelson





  _____

To unsubscribe from this list, please send an email to lists...@witango.com
<mailto:lists...@witango.com>  with "unsubscribe witango-talk" in the body.



Ben Johansen

http://www.webspinr.com <http://www.webspinr.com>

b...@webspinr.com <mailto:b...@webspinr.com>

Phone: 360-597-3372

Mobile: 360-600-7775








  _____

To unsubscribe from this list, please send an email to lists...@witango.com
<mailto:lists...@witango.com>  with "unsubscribe witango-talk" in the body.


----------------------------------------

To unsubscribe from this list, please send an email to lists...@witango.com 
with "unsubscribe witango-talk" in the body.

Reply via email to