Re: How to keep the sequence?

From: Kim Ng <kimmng_at_pebbles.uswnvg.com>
Date: 11 Jan 1995 19:49:40 GMT
Message-ID: <3f1cok$nq6_at_fred.uswnvg.com>


Based on your post, manipulating sequence number is the only way to do it. Of course, if you have a column somewhere that can identify the sequence, use it.

If you want to insert a record in between, you will have to re-sequence the rest of the data. I know, this is ugly. I had to this in one of my application. Another option is to use a large step initially and then use a smaller steps for inserted records. For example, the first time users create the data the sequence was: 1000, 2000, 3000, 4000, ..... When they insert a record between 1000 and 2000 then you create a sequence like 1100 for the new record. Hopefully users never insert more than what the "gap" allow. I dislike this method, though.

As to ORACLE's built in sequence generator, it depends on what you set as the maximum sequence it can have or whatever default ORACLE has for the number of digits (if you don't have any). I believe ORACLE can have up to 12 digits. However, most people use 9 digits (especially if they use PRO*C and don't like to handle numbers in some special ways).

Have fun



 (Whatever I say and own are mine, mine and only mine! So, don't you dare   claim they are yours!)
 Kim Ng
 Paradigm Computer Consulting, Inc.
 20611 E Bothell-Everett Hwy SE, Suite 280  Bothell, WA 98012
 U.S.A. Received on Wed Jan 11 1995 - 20:49:40 CET

Original text of this message