By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,197 Members | 959 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,197 IT Pros & Developers. It's quick & easy.

MERGE bug?

P: n/a
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
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production

the same situation...

"Shan R Shanmuganathan" <sh**@srinidhi.net> wrote in message
news:40**************************@posting.google.c om...
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

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.