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

Home -> Community -> Usenet -> c.d.o.server -> Re: select + insert vs. insert and catching exception

Re: select + insert vs. insert and catching exception

From: Richard Foote <richard.foote_at_bigpond.com>
Date: Thu, 26 Sep 2002 22:57:55 +1000
Message-ID: <umDk9.40468$g9.116855@newsfeeds.bigpond.com>


Hi Christopher,

I'll go for option two. Avoids having to unnecessarily perform the select and access the index twice.

I would also recommend the use of a sequence (if appropriate) to eliminate the potential duplicate key error.

Cheers

Richard
"Christoph Seidel" <chris666.seidel_at_gmx.de> wrote in message news:amut5g$9edrd$1_at_ID-143718.news.dfncis.de...
> what is better in respect of performance?
>
> select by primary key, if not found insert
>
> or
>
> insert and catch exception if primary key exists
>
> the table is quite small, less than 100 rows
>
>
Received on Thu Sep 26 2002 - 07:57:55 CDT

Original text of this message

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