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 -> help with my merge statement

help with my merge statement

From: <emdproduction_at_hotmail.com>
Date: 10 Jul 2006 07:08:08 -0700
Message-ID: <1152540488.479689.112930@m79g2000cwm.googlegroups.com>


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. Received on Mon Jul 10 2006 - 09:08:08 CDT

Original text of this message

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