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.
|
|
|