Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: retreiving CurrVal in a select statement.
On Mon, 01 Dec 1997 17:08:36 -0800, Kal Khatib <kal_at_gene.COM> wrote:
>How do you get the current value of a sequence in a select statement;
>I try;
>select CurrVal from some_sequence
>I get
>ORA-02201: sequence not allowed here
You can do:
select some_sequence.currval from dual;
However that's not safe if you want a unique value. To be sure that the value you get is unique, you should do:
select some_sequence.nextval from dual;
regards,
Jonathan Gennick
![]() |
![]() |