Re: getting sequence numbers?

From: <nwa_at_protocom.com>
Date: 1996/05/12
Message-ID: <4n3u9u$1cs_at_tracy.protocom.com>#1/1


In article <3190BDAB.2640_at_mhasoftware.com> "brian (bubba) martin" <bmartin_at_mhasoftware.com> wrote:

> i'm doing an multi-part insert into a database
> and using a sequence for my primary. i need
> to be able to pass that sequence number around
> to point back to that record from othe update
> procedures. i'm having trouble getting my var
> on the seq.currval. seems oracle doesn't allow
 

> We are what we post.

declare
val_var NUMBER;
begin
select seq.nextval into val_var from dual; insert into a values(val_var,....);
insert into b values (val_var,...);
..
end;
Using the currval in a production system is always a chancy thing
 since someone might do another insert between the time you generate a new sequence value and the time that you read the currval. Regards, mark Received on Sun May 12 1996 - 00:00:00 CEST

Original text of this message