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 -> Re: Merge statement? only want to update or insert merging field values if not nul

Re: Merge statement? only want to update or insert merging field values if not nul

From: NormaJean S via DBMonster.com <forum_at_DBMonster.com>
Date: Sun, 10 Jul 2005 20:25:14 GMT
Message-ID: <51207B0C15610@DBMonster.com>


fitzjarrell_at_cox.net wrote:
>> Hi,
>> I'm getting used to the merge statement. I really like it. I am using it in
>[quoted text clipped - 22 lines]
>> thanks,
>> Norma Jean
>
> MERGE
> INTO tab1
> USING tab2 ON (lower(tab1.title) = lower(tab2.title) )
> WHEN MATCHED THEN
> UPDATE SET
> tab1.code = nvl(tab2.code, tab1.code)
> WHEN NOT MATCHED THEN
> INSERT (id,code,title,description )
> VALUES (....[std stuff]..... );
>
>David Fitzjarell

-- 
Thank you for being out here on a Sunday (or maybe it's Monday already where
you are at)....

thank you!!  your quick answer was exactly what I needed.
Norma Jean


Message posted via http://www.dbmonster.com
Received on Sun Jul 10 2005 - 15:25:14 CDT

Original text of this message

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