Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: sequences
I wouldn't want you to think that I was splitting hairs or otherwise being pedantic; but your postings do demonstrate how difficult it can be to give a useful answer to a question:
You asked -
>>Is there any way to get the current value of a sequence, from a sqlplus
>>prompt, without using the sequence in an insert or select statement?
Your answer, which appears to satisfy your requirements, is:
>select tim_seq.nextval from dual;
This is a SELECT statement, and it doesn't get the current value, so is apparently the wrong answer to your own question on two separate counts ;)
-- Jonathan Lewis Yet another Oracle-related web site: http://www.jlcomp.demon.co.uk Practical Oracle 8i: Building Efficient Databases Publishers: Addison-Wesley Reviews at: http://www.jlcomp.demon.co.uk/book_rev.html Tim wrote in message ...Received on Wed May 09 2001 - 03:13:37 CDT
>Hehe, I actually solved this one before anyone replied. For those wanting
>to know the solution here it is. You just use a select statement like the
>following against the "dual" table, which is just a dummy table.
>
>select tim_seq.nextval from dual;
>
>That will give you the next value of the sequence as well as incrementing
>it.
>
>
>Tim
>
>Tim wrote in message <60XJ6.44$DP.832_at_client>...
>>Is there any way to get the current value of a sequence, from a sqlplus
>>prompt, without using the sequence in an insert or select statement?
>>
>>
>>Tim Troester
>>
>>
>
>