Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How get the current value from a sequence?

Re: How get the current value from a sequence?

From: Galen Boyer <galenboyer_at_hotpop.com>
Date: 3 Dec 2004 08:14:19 -0600
Message-ID: <u653j1ng2.fsf@standardandpoors.com>


On Fri, 3 Dec 2004, crb_at_amsa.gov.au wrote:

> Daniel Morgan wrote

>>
>> I believe you should try it.
>>
>> CREATE TABLE t (
>> numcol NUMBER(5));
>>
>> CREATE SEQUENCE seq_t;
>>
>> INSERT INTO t
>> (numcol)
>> SELECT seq_t.NEXTVAL FROM dual;
>>
>> SELECT * FROM t;
>>
>> And perhaps reconsider your response.
> 
> Daniel,
> 
> I don't need to reconsider my response, the original question
> was How [to] get the current value from a sequence?

Yes you do. Your statement that Daniel is telling you to reconsider is the following:

    I believe that executing the command

            select seq_name.nextval from dual;     does not increment the sequence (the first time), but defines     the sequence for the session.

This is incorrect, and there is no explanation other than it is incorrect.

-- 
Galen Boyer
Received on Fri Dec 03 2004 - 08:14:19 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US