Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: help with my merge statement

Re: help with my merge statement

From: Maxim Demenko <mdemenko_at_arcor.de>
Date: Mon, 10 Jul 2006 16:19:02 +0200
Message-ID: <44b2634c$0$29136$9b4e6d93@newsread4.arcor-online.net>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US