Home » RDBMS Server » Server Administration » updating table with another table
updating table with another table [message #374261] Mon, 04 June 2001 00:10 Go to next message
m. durga prasad
Messages: 1
Registered: June 2001
Junior Member
Sir I have a proble with updating table with another table. Suppose Emp and Emp1 are two tables with same columns and emp1 have 90% rows of emp. During the updating process emp1 e_name of some records were lost. Thus updating emp1 with emp table where e_code is same. This makes error. I have given command as

update emp1 set e_name=emp.e_name where emp1.e_name is null and emp1.e_code=emp.e_code;

This reports invalid column name.

please suggest me to update the emp1 table where e_name is null with emp table e_name.

Thanking you Sir.
Re: updating table with another table [message #374262 is a reply to message #374261] Mon, 04 June 2001 00:22 Go to previous messageGo to next message
GIRIDHAR KODAKALLA
Messages: 92
Registered: May 2001
Member
hai Durga Prasad,
Pls try this statement for updation.

update emp1 e1 set e1.ename = (select e2.ename from emp e2 where
e2.empno=e1.empno) where e1.ename is null

Cheers,
Giridhar Kodakalla
Re: updating table with another table [message #374263 is a reply to message #374261] Mon, 04 June 2001 00:28 Go to previous messageGo to next message
GIRIDHAR KODAKALLA
Messages: 92
Registered: May 2001
Member
hai Durga Prasad,
Pls try this statement for updation.

update emp1 e1 set e1.ename = (select e2.ename from emp e2 where
e2.empno=e1.empno) where e1.ename is null

Cheers,
Giridhar Kodakalla
Re: updating table with another table [message #374264 is a reply to message #374261] Mon, 04 June 2001 00:28 Go to previous messageGo to next message
GIRIDHAR KODAKALLA
Messages: 92
Registered: May 2001
Member
hai Durga Prasad,
Pls try this statement for updation.

update emp1 e1 set e1.ename = (select e2.ename from emp e2 where
e2.empno=e1.empno) where e1.ename is null

Cheers,
Giridhar Kodakalla
Re: updating table with another table [message #374265 is a reply to message #374261] Mon, 04 June 2001 00:37 Go to previous message
GIRIDHAR KODAKALLA
Messages: 92
Registered: May 2001
Member
hai Durga Prasad,
Pls try this statement for updation.

update emp1 e1 set e1.ename = (select e2.ename from emp e2 where
e2.empno=e1.empno) where e1.ename is null

Cheers,
Giridhar Kodakalla
Previous Topic: create view
Next Topic: Re: What is use of 'raise' command in pl/sql
Goto Forum:
  


Current Time: Thu Jul 04 03:06:53 CDT 2024