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 question

Re: MERGE question

From: Hans Forbrich <forbrich_at_yahoo.net>
Date: Fri, 07 Nov 2003 18:05:46 GMT
Message-ID: <3FABDF4E.874AF407@yahoo.net>


RR wrote:
>
> Hi all, I'm curious to know if anyone has tested the merge function or
> knows how it works more or less. Assuming that you are merging two
> identical tables with nearly identical values: Does it, when it finds
> a match, update all columns in that row, only columns that are
> different, or skip that row if there are no differences?
> I would assume the latter, but admittedly haven't tested it, so I was
> wondering if anyone knew the answer offhand.
>

Basically you write a merge statement with 3 parts:

  1. The condition (select statement) used to indicate a match
  2. pretty much a regular Update statement
  3. pretty much a regular Insert statement

the 'pretty much' comments indicate the syntax for that section is different, but recognizable, as derived from a traditional update/insert.

In other words, you tell it explicitly how to handle the update or insert.

(You might enjoy reading about it in the manual - it's pretty well documented. Anything short of your own research will likely give you an incorrect impression how it actually works.)

HTH/Hans Received on Fri Nov 07 2003 - 12:05:46 CST

Original text of this message

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