Re: Oracle Merge Statement -sample query

From: <fitzjarrell_at_cox.net>
Date: Tue, 20 May 2008 05:39:56 -0700 (PDT)
Message-ID: <9e044ce4-2e7b-4a12-8155-e229ee2a0bd8@56g2000hsm.googlegroups.com>


On May 20, 4:59 am, idey <dey.indra..._at_gmail.com> wrote:
> 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.

Then show us what you've tried, as this appears to be an assignment for school. We won't do your homework for you , but we WILL offer assistance when we see what you've tried.

David Fitzjarrell Received on Tue May 20 2008 - 07:39:56 CDT

Original text of this message