Re: getting sequence numbers?

From: Thomas J Kyte <tkyte_at_us.oracle.com>
Date: 1996/05/12
Message-ID: <31953bcb.2185712_at_dcsun4>#1/1


The ever magic dual table....

select seqname.currval into :n from dual;

will do it.

"brian (bubba) martin" <bmartin_at_mhasoftware.com> wrote:

>brass tacks:
>how do i find (read: set a var equal to) the seq
>number i'm generating on an insert?
>
>the whole enchilada:
>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
>it to be accessed anywhere but in the select/insert
>values clause.
>
>anybody know how to set a variable to the currval?
>anybody have a better way to do this?
>
>--
>===
>Brian (bubba) Martin
>
>We are what we post.

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government



opinions and statements are mine and do not necessarily reflect the opinions of Oracle Corporation. Received on Sun May 12 1996 - 00:00:00 CEST

Original text of this message