Oracle Merge Statement -sample query

From: idey <dey.indranil_at_gmail.com>
Date: Tue, 20 May 2008 02:59:26 -0700 (PDT)
Message-ID: <a3272827-f923-48a5-8387-a439a2449019@p25g2000pri.googlegroups.com>


Hi All,
I have a simple question but i am in a fix coz of it. This is regarding Oracle Merge statement.

The question is:

I have a table say

Employee
- Name varchar2(20)

  • ID pk number
  • salary number

I want to check whether ID = 20 exists or not. If yes, then update salary = salary +10000;
else insert the row with default values.

Can someone give me the SQL for this? I have tried all the seemingly normal approaches.

Regards,
Indranil. Received on Tue May 20 2008 - 04:59:26 CDT

Original text of this message