Re: how to insert characters in existing field

From: Hugo Kornelis (hugo_at_pe_NO_rFact.in_SPAM_fo)
Date: 02/16/05


Date: Wed, 16 Feb 2005 21:04:39 +0100

On Wed, 16 Feb 2005 07:09:06 -0800, Bosse wrote:

>Steve!
>
>I have a similar problem where I want to replace the domain part in a column
>with e-mail addresses. Like aaa@xxx.se with aaa@yyy.se. I tried using the
>tip you gave Tiffany but nothing happens.
>Any clues?
>
>Regards,
>Bosse

Hi Bosse,

Steve's message to Tiffany was about how to put some extra characters in
front of existing string data. To replace a part of existing string data,
you use the REPLACE function instead.

UPDATE MyTable
SET Email = REPLACE (Email, '@xxx.se', '@yyy.se')
WHERE Email LIKE '%@xxx.se'

Note the extra @ and .se inserted in the replace, to make sure that an
address like aaxxxt@xxx.se is not accidentaly changed to aayyyt@yyy.se.

Best, Hugo

-- 
(Remove _NO_ and _SPAM_ to get my e-mail address)