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:
> Hi all
>
> DA Morgan wrote in response to
>
>>>whats wrong with select seq_name.nextval fom dual?
>>One big thing ... that being you just took another number off the >>top of the sequence.
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 A. Morgan University of Washington damorgan_at_x.washington.edu (replace 'x' with 'u' to respond)Received on Thu Dec 02 2004 - 18:07:07 CST