Home » SQL & PL/SQL » SQL & PL/SQL » Issue in inserting table data through DB Link (PL/SQL Release 11.2)
Issue in inserting table data through DB Link [message #610470] Thu, 20 March 2014 07:31 Go to next message
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 Go to previous messageGo to next message
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 as
insert into table1 (id, ename, job, sal) 
select id, ename, job, sal
from table1@dblink_name
Re: Issue in inserting table data through DB Link [message #610479 is a reply to message #610473] Thu, 20 March 2014 08:46 Go to previous message
Chinmay91
Messages: 15
Registered: July 2013
Location: Mumbai
Junior Member
Thanks Littlefoot. There was a miss match in table definition for which we were getting error
Previous Topic: variable value's length is not checked during compilition
Next Topic: can someone tell me why this sp takes so much time?
Goto Forum:
  


Current Time: Tue Apr 23 21:51:28 CDT 2024