904 invalid identifier error with merge
ant7Nov 16 2005 — edited May 9 2008I have two systems, one is dev and the other is production. I am attempting to update production from dev via db links and merge. In most cases this works flawlessly, however there are a couple of instances where I am getting a ORA-904 invalid indentifier error.
One of the problem statements is:
merge into md_job_action@my_link a
using (
select action_key ,job_key ,action_order ,column_key ,email_address ,refresh_status
from md_job_action
where instr(job_key,nvl(:key,job_key))>0
and upper(refresh_status)=upper(:status)) b
on (a.action_key=b.action_key and a.job_key=b.job_key)
when matched then
update set action_key=b.action_key
,job_key=b.job_key
,action_order=b.action_order
,column_key=b.column_key
,email_address=b.email_address
when not matched then
insert (action_key ,job_key ,action_order ,column_key ,email_address)
values (b.action_key, b.job_key, b.action_order, b.column_key,b.email_address);
on (a.action_key=b.action_key and a.job_key=b.job_key)
*
ERROR at line 8:
ORA-00604: error occurred at recursive SQL level 1
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 23
ORA-00904: "A"."ACTION_KEY": invalid identifier
I have verified that both tables have the same layout, the columns are of the same data type and so forth. Given that this works for other table across the same two systems I am left with some odd syntax error that I am failing to see.
I am hoping that this is simply a case of needing a second pair of eyes to catch a silly problem. Does anyone see it or have a suggestion?