Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: update email address
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
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
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
![]() |
![]() |