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: Lock record

Re: Lock record

From: Michel Cadot <micadot_at_netcourrier.com>
Date: Wed, 1 Aug 2001 12:43:43 +0200
Message-ID: <9k8mh0$agd$1@s1.read.news.oleane.net>

Answer embedded but one question:
why don't you use sequences?

--
Have a nice day
Michel


"Arnaud BALAY" <arnaud_at_europrint.fr> a écrit dans le message news:
9k8f4l$1ip$1_at_front7m.grolier.fr...

> Hi,
>
> This is surely a commun question, but I can't get any answer.
> A table on my DB contains all counters. One record of this table contains
> the current order number. What is the correct way to use and change the
> current order number ?
> Is this correct :
> -Lock the record (How ?)
> -Read the current order number
2 first steps in one statement: select name, value from counters where name='<my counter>' for update of value;
> -Write the next one
update counters set value=value+1 where name='<my counter>';
> -Unlock the record (How ?)
commit;
> -Use the read order number to add a new order
>
> Thanks for your help.
>
> Arnaud
>
>
Received on Wed Aug 01 2001 - 05:43:43 CDT

Original text of this message

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