Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: two inserts at same time
Couldn't you use select for update to lock the data?
-- Dave A <myarch5_at_hotmail.com> wrote in message news:8rd6qg$4ol$1_at_nnrp1.deja.com...Received on Thu Oct 05 2000 - 22:15:26 CDT
> if there are two processes A and B, and they both go to INSERT
> the same record and process A COMMITS first, will process B then
> go to COMMIT its INSERT and then bomb because a record already exists?
>
> I have a situation where i need to do a
> 'select count(*) from miketable where user = 100'
> to determine if i should INSERT or UPDATE....
>
> If I determine that I INSERT, i'm concerned between the
> SELECT and INSERT that another process INSERTS the
> record......which means i would need a UPDATE instead...
>
> mike
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
![]() |
![]() |