1
votes

i'm having two DB (DB1 & DB2) in oracle SQL developer.I need to copy a column of DB1.table1 to the table of DB2.table2. I tried many times but its not working

INSERT INTO database1.table1 ( column1,column2 )SELECT (column1,column2) FROM database2.table2

please help. I want to insert only one row at a time.

1

1 Answers

2
votes

If you have db link then you can do in following manner

INSERT INTO table1 ( column1,column2 )
SELECT (column1,column2) FROM table2@dblink

for eg: I have two database db1 and db2, db link between them is ipdb and i have to copy the column from db1 table to db2 table.

INSERT INTO table2 ( column1,column2 )
SELECT (column1,column2) FROM table1@dblink

table1 is in db1 and table2 is in db2