Home » SQL & PL/SQL » SQL & PL/SQL » MERGE/ORA-00904/DECODE: Doesn't work with DB LINK
MERGE/ORA-00904/DECODE: Doesn't work with DB LINK [message #184682] Thu, 27 July 2006 08:01
Clark
Messages: 3
Registered: October 2004
Junior Member
If I run the following

merge into table_a a using (select decode(x,'x','z') x from table_b) b
on (a.id = b.id)
when matched
update
set a.x = b.x
when not matched then
insert (a.x) values (b.x);

this works on the host for table_a and table_b, however if I try to run it across a db_link, I get:

merge into table_a@OTHER_SERVER a using (select decode(x,'x','z') x from table_b@OTHER_SERVER) b
on (a.id = b.id)
when matched
update
set a.x = b.x
when not matched then
insert (a.x) values (b.x);


ERROR at line 1:
ORA-00904: "A2"."X": invalid identifier
ORA-02063: preceding line from OTHER_SERVER

Removing the decode fixes the error.
Previous Topic: showing errors while creating stored procedure (pls-00103)
Next Topic: how to get rid of full table scan
Goto Forum:
  


Current Time: Mon Dec 05 21:13:18 CST 2016

Total time taken to generate the page: 0.09337 seconds