Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 10:39 PM
Shan R Shanmuganathan
Guest
 
Posts: n/a
Default MERGE bug?

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
  #2  
Old July 19th, 2005, 10:39 PM
Renvaldas Mackevicius
Guest
 
Posts: n/a
Default Re: MERGE bug?

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" <shan@srinidhi.net> wrote in message
news:408f220d.0402262241.493d950d@posting.google.c om...[color=blue]
> 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[/color]


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles