| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How get the current value from a sequence?
Craig & Co. 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.
To quote Galen Boyer who said it better than I could:
"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."
Thanks Galen.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace 'x' with 'u' to respond)Received on Fri Dec 03 2004 - 20:20:22 CST
![]() |
![]() |