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 -> simple MERGE INTO test; bug or feature?

simple MERGE INTO test; bug or feature?

From: Shan R Shanmuganathan <shan_at_srinidhi.net>
Date: 26 Feb 2004 00:16:51 -0800
Message-ID: <408f220d.0402260016.7334c332@posting.google.com>


Try this:

create table xyz ( c1 number );

insert into xyz values ( 5 );

1 row created.

select * from xyz;

        C1


         5

merge into xyz
using (select * from dual) A
on ( 1=1 )
when matched then
update set c1 = 10
when not matched then
insert values ( 20 );

1 row merged.

select * from xyz;

        C1


        10

merge into xyz
using (select * from dual) A
on ( 1=2 )
when matched then
update set c1 = 10
when not matched then
insert values ( 20 );

0 row merged.

Why is it not inserting in the second merge?

9.2 SQL reference guide allows me to use any 'condition' inside the on ().

Bug??

BTW, I have 9.2.0.3.0.

Thanks,
Shan R Shanmuganathan Received on Thu Feb 26 2004 - 02:16:51 CST

Original text of this message

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