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

Home -> Community -> Usenet -> c.d.o.server -> Re: Questions about Oracle-Sequences

Re: Questions about Oracle-Sequences

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Mon, 14 Oct 2002 15:59:30 GMT
Message-ID: <3DAAE9DD.220A7168@exesolutions.com>


Norman Dunbar wrote:

> Morning James,
>
> sequences can be defined with an upper limit :
>
> CREATE SEQUENCE BLAH MAXVALUE 7777777 ...............
>
> So this sequence won't ba allowed to give a value higher than 7,777,777,
> if you try, you will get an error. I believe the maximum value allowed
> is a number consisting of 28 9s so it should be big enough. :o)
>
> On Interbase/Firebird, sequences (generators) can have a different
> increment applied each time, under oracle, the increment is built in at
> creation time. The default is 1, but you can change it by using the
> INCREMENT BY n clause, as in :
>
> CREATE SEQUENCE BLAH MAXVALUE 7777777 INCREMENT BY 7 ................
>
> When you select BLAH.NEXTVAL from dual, the sequence is automatically
> incremented by the increment amount. You cannot stop this from happening
> - not like in Interbase/Firebird.
>
> HTH
>
> Norman.
>
> -------------------------------------
> Norman Dunbar
> Database/Unix administrator
> Lynx Financial Systems Ltd.
> mailto:Norman.Dunbar_at_LFS.co.uk
> Tel: 0113 289 6265
> Fax: 0113 289 3146
> URL: http://www.Lynx-FS.com
> -------------------------------------
>
> -----Original Message-----
> From: JW [mailto:Benutzer_at_beispiel.net]
> Posted At: Monday, October 14, 2002 9:17 AM
> Posted To: server
> Conversation: Questions about Oracle-Sequences
> Subject: Questions about Oracle-Sequences
>
> Hi!
>
> I´ve got two questions concerning the use use of Oracle sequences. First
>
> of all I want to know, how many values a sequence can have. Is there an
> end or is it open end?
>
> Otherwise I want to know, how I can manually increment the sequence
> while selecting. On Interbase, I can do a select (seq,2) and the
> sequence will be incremented by 2. Ist there any chance for this on
> Oracle too?
>
> Greetings
>
> James

DESC user_sequences

The max value is 27 digits. But close enough.

col max_value format 9999999999999999999999999999999999999999

SELECT max_value
FROM user_sequences
WHERE rownum = 1;

                                MAX_VALUE
-----------------------------------------
              999999999999999999999999999

Daniel Morgan Received on Mon Oct 14 2002 - 10:59:30 CDT

Original text of this message

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