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

Home -> Community -> Usenet -> c.d.o.tools -> Re: sequences

Re: sequences

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Wed, 9 May 2001 09:13:37 +0100
Message-ID: <989395817.11595.0.nnrp-10.9e984b29@news.demon.co.uk>

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 ...

>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
>>
>>
>
>
Received on Wed May 09 2001 - 03:13:37 CDT

Original text of this message

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