Home » RDBMS Server » Server Administration » transferring data from a table to another table
transferring data from a table to another table [message #371992] Tue, 02 January 2001 01:20 Go to next message
Alvin
Messages: 7
Registered: December 2000
Junior Member
Good day!

I need to transfer data from a column in one table to another column of a different table. How can i do this?

-Alvin
Re: transferring data from a table to another table [message #371996 is a reply to message #371992] Tue, 02 January 2001 12:28 Go to previous messageGo to next message
sverch
Messages: 582
Registered: December 2000
Senior Member
INSERT INTO TABLE1 (COLUMN1) SELECT COLUMN1 FROM
TABLE2;
0r
UPDATE TABLE1 A SET COLUMN1=(SELECT COLUMN1 FROM
TABLE2 WHERE .....);

Or SELECT 'UPDATE TABLE1 SET
COLUMN1= '||COLUMN1||
' WHERE COLUMN2= '||COLUMN2||' AND...='||...||';'
FROM TABLE2;

Don't forget to put 3 parens if your datatype is CHAR or VARCHAR or like...
Re: transferring data from a table to another table [message #372032 is a reply to message #371992] Fri, 05 January 2001 04:57 Go to previous message
Alvin
Messages: 7
Registered: December 2000
Junior Member
Hi!

Thanks for the help. But I need some more clarification.

Actually, what im trying to do is transfer to a table data from another table with certain conditions.

This is the script I made but it returns an error
at line 3.
ORA-01427: single-row subquery returns more than one row

update c_cell_in_msc
set bts_int_id=
(select b.int_id
from c_cell_in_msc a, c_bts b
where conf_name = '<ACTUAL>'
and a.int_id = b.btsm_int_id
and a.cell_id = b.cell_id
and b.conf_name = '<ACTUAL>')
where conf_name = '<ACTUAL>'
and bts_int_id is NULL
/

Thanks!
-Alvin
Previous Topic: max length of oracle query
Next Topic: Re: Datatype FLOAT
Goto Forum:
  


Current Time: Fri May 17 03:41:19 CDT 2024