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 -> Questions about Oracle-Sequences

Questions about Oracle-Sequences

From: Norman Dunbar <Norman.Dunbar_at_lfs.co.uk>
Date: Mon, 14 Oct 2002 09:49:26 +0100
Message-ID: <E2F6A70FE45242488C865C3BC1245DA702C89177@lnewton.leeds.lfs.co.uk>


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 Received on Mon Oct 14 2002 - 03:49:26 CDT

Original text of this message

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