Re: Help with Sequences Needed

From: Daniel Druker <ddruker_at_agsm.ucla.edu>
Date: 15 Feb 93 02:12:09 PST
Message-ID: <1993Feb15.021209.2651_at_mic.ucla.edu>


In article <93044.113028AI4CPHYW_at_MIAMIU.BITNET> <AI4CPHYW_at_MIAMIU.BITNET> writes:
>Hello There:
>
>I am writing an application in sqlforms30 that, among other things,
>constructs a complex identifier that includes a 5 digit serial number.
>Since the serial number range was assigned to us by an outside
>source, wasted numbers are unacceptable. What I did is create a

By definition, Oracle Sequences only guarantee you unique numbers, not contiguous numbers. If you are cacheing greater than 1 sequence numbers in memory, for examply, you'll be updated to the next increment everytime the database restarts.

I don't think sequences are the right way to go if you application demands contiguous numbers. Use the venerable (But slow) method of a single table with a single column, with a single row containing the current sequence value, update it to increment and to get an exclusive lock, and so on...

  • Dan

Daniel Druker
Anderson Graduate School of Management at UCLA                    


| Dan Druker                                                               |
| agsm mail 	: ddruker                                                  |
| internet 	: ddruker_at_agsm.ucla.edu                                    |
| oracle*mail	: unix:ddruker_at_agsm.ucla.edu                               |
----------------------------------------------------------------------------

Disclaimer: None. I'm a student now and I don't care what you think. Received on Mon Feb 15 1993 - 11:12:09 CET

Original text of this message