Re: Sequence Numbers - Can you read them synchronously?

From: Suresh B Peram <peram_at_cs.tamu.edu>
Date: 1995/04/03
Message-ID: <3lov2i$4as_at_news.tamu.edu>#1/1


In article <3lhsml$1u0_at_homer.alpha.net>, Saad Ahmad <sahmad_at_mfa.com> wrote:
>Suresh B Peram (peram_at_cs.tamu.edu) wrote:
>> Is there way to immediately read the value of a
>> sequence number right after you do a seq.NEXTVAL ?
>> We have been trying to find a way read the new value
>> efficiently......
>
>Do you mean seq.currval,
>

 We have multiple processes trying to insert rows into a table.  One of the columns is a sequence number. Insertions are being  done using stored procedures. The sequence number is the only  primary key to the table.

 When I insert a rows into the table, I do a 'nextval' on the  sequence number. At this time, I would like to get the value  of the sequence number back for use in another table. But, I am  afraid that some other process could be updating the table at the  same time. This means that I would not be able to use 'currval' after  I do a 'nextval' because the sequence number could be updated in between.

 How should I address this problem?

 Suresh

-- 
-----------------------------------------------------------------------
Suresh B Peram                  |       Graduate Assistant Non-Teaching
Department of Computer Science  |        Member of UPE CS Honor Society
Texas A&M, College St TX 77840  | Member of IEEE Computer Society & ACM
Received on Mon Apr 03 1995 - 00:00:00 CEST

Original text of this message