Re: sequence curval

From: <U19822_at_uicvm.uic.edu>
Date: 1996/04/26
Message-ID: <96117.230712U19822_at_uicvm.uic.edu>#1/1


             Hui Li <li_at_openmarket.com>
>
> Sequence vs. identity
> In the Sybase, you can use 'select _at__at_identity'
 yyto get the identity value used without requiring the transaction. When
> using
> a sequence we can do
> 'select sequence.curval from dual'
> (Does this require a transaction?, dual is a system table)
> to get the value used. Assume I have two processes;
>
> Process 1 Process 2
> --------- ---------
> insert record
> insert record
> select seq.curval from dual
> select seq.curval from dual
>
> If the second record is inserted before the first process 'select'. What
> curval I will get from procees 1?
>
> ----------------------------------------------------------------------
> Shuzi Chen
> chen_at_openmarket.com

   Oracle sequence does not require transaction.    I am not clear what the "insert record" is.    You need to call NEXTVAL to generate the next sequence value before  you can call CURVAL to get the current sequence value.    The two process(session) will get their own current sequence value. Received on Fri Apr 26 1996 - 00:00:00 CEST

Original text of this message