Issue in inserting table data through DB Link [message #610470] |
Thu, 20 March 2014 07:31 |
|
Chinmay91
Messages: 15 Registered: July 2013 Location: Mumbai
|
Junior Member |
|
|
Hi All,
I am trying to insert one table data into local DB table through dblink. Below are the queries that I have already tried:
INSERT INTO table1
SELECT * FROM table1@DBLink_Name;
Error: Invalid Number
SELECT *
INTO table1
FROM table1@DBLink_Name
Error: Missing Expression
Can somebody explain what is wrong with these queries?
Thanks in advance
|
|
|
Re: Issue in inserting table data through DB Link [message #610473 is a reply to message #610470] |
Thu, 20 March 2014 07:41 |
|
Littlefoot
Messages: 21807 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
The second syntax is invalid (so forget about it).
The first one means that local TABLE1 and TABLE1 over a database link have different description and Oracle is unable to implicitly match datatypes. Therefore, compare these two tables and fix the error. Hint: don't do "select *" - write a full INSERT statement, such asinsert into table1 (id, ename, job, sal)
select id, ename, job, sal
from table1@dblink_name
|
|
|
|