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 -> Problems with MERGE INTO statement

Problems with MERGE INTO statement

From: Matthias Wirtz <Matthias.Wirtz_at_epost.de>
Date: Sat, 22 Jan 2005 17:51:05 -0500
Message-ID: <35g3moF4m62aeU1@individual.net>


Hi,

I'm playing with the merge into statement but got stuck on this easy thing:

stat_at_DEV> CREATE TABLE t1 (id NUMBER, value NUMBER);

Table created.

stat_at_DEV>
stat_at_DEV> MERGE INTO t1
  2 USING t1 ON (id = 1)
  3 WHEN MATCHED THEN UPDATE SET value = 20   4 WHEN NOT MATCHED THEN INSERT (id, value) VALUES (1, 20);   WHEN MATCHED THEN UPDATE SET value = 20   *
ERROR at line 3:
ORA-00918: column ambiguously defined

I thought that would be an easy example. I want to add a entry into t1 but do not know if there is already an entry with id=1. So I thought using merge could save me the query in the beginning. Maybe someone could point me to the problem.

--
Matthias Wirtz  -  Norfolk, USA
Received on Sat Jan 22 2005 - 16:51:05 CST

Original text of this message

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