Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Merge statement? only want to update or insert merging field values if not nul
Hi,
I'm getting used to the merge statement. I really like it. I am using it in
combination with external tables.
But I am pretty new at this (or pretty rusty, depending on your point of view)
....
I would like to know how i can add "update if not null" logic to my merge statement (i hope it is possible).
For example,
MERGE INTO tab1 USING tab2 ON (lower(tab1.title) = lower(tab2.title) ) WHEN MATCHED THEN UPDATE SET tab1.code = tab2.code WHEN NOT MATCHED THEN INSERT (id,code,title,description ) VALUES (....[std stuff]..... );
in the update clause, i only want to update tab1.code with tab2.code if tab2. code is not null. Can I do that, if so, what's the syntax?
please advise....
thanks,
Norma Jean
-- Message posted via http://www.dbmonster.comReceived on Sun Jul 10 2005 - 15:07:33 CDT