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 -> How to use merge not to do an upsert but to do a simple update

How to use merge not to do an upsert but to do a simple update

From: <chirantan.chakraborty_at_gmail.com>
Date: 10 Dec 2004 16:18:54 -0800
Message-ID: <1102724333.989213.186730@f14g2000cwb.googlegroups.com>


Hi All,

Although the main purpose of using MERGE in Oracle 9i is to do UPSERT, but I somehow want to find out if it is at all possible for us to do a plain UPDATE with it instead.

I know I can use a CURSOR to do this, but I would like to experiment with MERGE.



MERGE INTO SERVICE_TYPE_DIM A
USING SERVICE_TYPE_DIM_BK B
on
(

A.SERVICE_TYPE_CDE = B.SERVICE_TYPE_CDE
)
WHEN MATCHED THEN UPDATE
SET
A.SERVICE_TYPE_DIM_KEY = B.SERVICE_TYPE_DIM_KEY WHEN NOT MATCHED THEN
-- do not want to insert anything
INSERT()
VALUES
(

)

Please let me know if there is a way to not use "WHEN NOT MATCHED THEN" part. Any response would be appreciated.

Thanks,

Received on Fri Dec 10 2004 - 18:18:54 CST

Original text of this message

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