Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: help with my merge statement
emdproduction_at_hotmail.com schrieb:
> I have a table
> A (id1, id2, id3), B(id1,id2,id3)
>
> What I wnat is, if (id1 and id2) both matches, then update id3,
> if not matches, then insert
>
> merge into A using B
> on (A.id1 = b.id1,a.id2 = b.id2)
> when matched then
> update set a.id3= b.id3
> when not matched then
> insert (a.id1, a.id2, a.id3)
> values (b.id1, b.id2, b.id3)
> ERROR at line 2:
> ORA-00907: missing right parenthesis
>
> How can I achive this?
>
> Thanks for your help.
>
is
on (A.id1 = b.id1,a.id2 = b.id2)
should be
on (A.id1 = b.id1 and a.id2 = b.id2)
Best regards
Maxim Received on Mon Jul 10 2006 - 09:19:02 CDT