Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Retrieving the key of a newly inserted record
On 20 Dec 2002, claus_scherschel_at_operamail.com wrote:
> Galen Boyer <galenboyer_at_hotpop.com> wrote in
> news:u7ke4zczb.fsf_at_standardandpoors.com:
>
>> On insert use seq_name.nextval then in same session you can >> ask for seq_name.currval.
Yes. If you go into sqlplus and run the command
select seq_name.currval from dual;
you will see an error. But, then run
select seq_name.nextval from dual;
you will get a value. Now run
select seq_name.currval from dual;
you will get the same value.
Open up another sqlplus session and do the same thing, then go back to the previous sqlplus session. Notice what numbers show up. That is how the numbers will behave for your proc.
> A thousand thanks, this sounds good to me.
>
> Regards, Claus.
-- Galen BoyerReceived on Fri Dec 20 2002 - 14:50:20 CST
![]() |
![]() |