SQLTeam.com | Weblogs | Forums

Linked server openquery for insert into oracle


#1

Hi

I am doing insert openquery through linked server
Is it possible to use openquery to insert record into oracle table of one schema from joining between oracle table only but from different schema.

like
insert into (lnk_ora, 'insert into oracle schema1.table(col1, col2)
select column_1, column_2 from oracle schema2.table')

T.I.A


#2

I don't think you can do that.


#3

I'm not sure if this will work, but I suggest trying:

EXEC('insert into oracle schema1.table(col1, col2) select column_1, column_2 from oracle schema2.table;’) AT [lnk_ora];

I believe the closing semi-colon is significant in Oracle (or at least it used to be).


#4

Thank you! It worked!!


#5

Great! And thanks for confirming back to me that it did indeed work: I knew it should, but sometimes computers see things differently than people :grin: