Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: update email address

Re: update email address

From: DA Morgan <damorgan_at_x.washington.edu>
Date: Tue, 05 Apr 2005 22:20:16 -0700
Message-ID: <1112764595.621642@yasure>


Sheela wrote:

> Hi there,
> I would like to update 5000 email address from
>
> name_at_xxxxxx.com to name_at_yyyyy.com.
> name1_at_xxxxxx.com to name1_at_yyyyy.com
> -----
> ------
> -----
> I tried this statment :
> update student a set
> substr(a.email_addr,(instr(a.email_addr,'@')+1),10) = 'yyyyy.com'where
> stud_id like 'name'
>
>
> but I am getting ORA-00927: missing equal sign
>
>
> How I can do that using update statment?
>
> Thanks

SQL> create table student (

   2 email_addr varchar2(30));

Table created.

SQL> insert into student values ('damorgan_at_x.washington.edu');

1 row created.

SQL> commit;

Commit complete.

SQL> select * from student;

EMAIL_ADDR



damorgan_at_u.washington.edu

SQL> UPDATE student

   2 SET email_addr = REPLACE(email_addr, SUBSTR(email_addr, INSTR(email_addr, '@', 1, 1)+1),'yyyyy.com');

1 row updated.

SQL> select * from student;

EMAIL_ADDR



damorgan_at_yyyyy.com

SQL>

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Wed Apr 06 2005 - 00:20:16 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US