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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Problem With Merge Statement

Re: Problem With Merge Statement

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Thu, 06 Apr 2006 07:09:06 +0200
Message-ID: <5i89329injts10d503pad58o0eib4kk367@4ax.com>


On 5 Apr 2006 15:08:30 -0700, pankaj_wolfhunter_at_yahoo.co.in wrote:

>MERGE INTO ext_category t_dest
>USING ( SELECT * FROM category) t_src
>ON (t_dest.name = t_src.name
> and t_dest.exp_date IS NULL
> and t_dest.exp_time IS NULL
> )
>WHEN MATCHED THEN
> UPDATE SET t_dest.exp_date=t_src.exp_date,
>t_dest.exp_time=t_src.exp_time
>WHEN NOT MATCHED THEN
> INSERT(name, exp_date, exp_time, flg)
> VALUES(t_src.name, t_src.exp_date, t_exp_time, t_src.flg);
>
>But its giving me the error that I cannot update the columns referenced
>
>in ON clause.
>
>Can anyone please tell me a workaround. I'll be happy if it's still
>possible to
>do it using MERGE statement or any other workaround?

No workaround needed if you would try to understand the error message and adjust the statement accordingly.

--
Sybrand Bakker, Senior Oracle DBA
Received on Thu Apr 06 2006 - 00:09:06 CDT

Original text of this message

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