Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: "insert or update" in one step?

Re: "insert or update" in one step?

From: Spencer <spencerp_at_swbell.net>
Date: Wed, 30 May 2001 21:02:26 -0500
Message-ID: <aBhR6.139$fw1.191464@nnrp2.sbc.net>

the only way to an "update/insert" in a single call to the database is to use a pl/sql block (either anonymous or stored will work)

you've got the idea though... select "for update" the row by key value. if found, update it, if not found, then insert.

HTH "Todd" <gdulli_at_zdnetmail.edu> wrote in message news:3b159f56$0$1877_at_news.denver1.Level3.net...
> Is there a way to do an "insert or update" statement in one step? i.e.
 I
> want to insert a certain row if it's not there, or else just update it,
 without
> doing a select first and then branching to either an insert or update.
>
> Thanks! - Todd (gdulli_at_zdnetmail.edu - change edu to com)
>
>
>
Received on Wed May 30 2001 - 21:02:26 CDT

Original text of this message

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