tags:

views:

38

answers:

1

Hi,

I am new to Oracle and I want to check if particular primary key value is present or not. If value exists then just update the entire row .If value is not present, then insert new row.

INSERT INTO table (a,b,c) VALUES (1,2,3)
  ON DUPLICATE KEY UPDATE c=c+1;

Code above works on MySql. How to achieve the same in Oracle 10g? Can anyone please help?

+1  A: 

Look up the SQL standard MERGE statement, which is supported by (more recent versions of) Oracle. This will work with other DBMS than Oracle too.

Jonathan Leffler
thanks a lot jonathan !!!!I am checking t he link given by you
Shekhar