home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!bcm!mparsons
- From: mparsons@fleming.csc.bcm.tmc.edu (Mark Parsons)
- Newsgroups: comp.databases.sybase
- Subject: Re: Sequencer or Serial
- Message-ID: <14821@gazette.bcm.tmc.edu>
- Date: 14 Sep 1992 20:05:50 GMT
- References: <howard.716498215@judy.cs.iastate.edu>
- Sender: usenet@bcm.tmc.edu
- Reply-To: mparsons@fleming.csc.bcm.tmc.edu (Mark Parsons)
- Organization: Baylor College of Medicine, Houston, Tx
- Lines: 29
- Nntp-Posting-Host: fleming.csc.bcm.tmc.edu
- Originator: mparsons@fleming.csc.bcm.tmc.edu
-
-
- In article <howard.716498215@judy.cs.iastate.edu>, howard@cs.iastate.edu (Chris howard) writes:
- |> We need some help in discovering the most appropriate way
- |> to achieve a non-repeating unique item number, like
- |> the Sequencer facility in Oracle, or the Serial datatype
- |> in Informix.
-
-
- I don't know what Informix does, and this may be oversimplified
- for what you need . . .
-
- Why not set up one table, with one column of type int. Lock
- the table when accessing/updating it. The idea is that this
- column will hold a counter . . . just increment the column
- each time you read the number . .
-
- Or as someone mentioned here in the past day or two, increment
- and then read it to cut down on possiblities of deadlock?
-
- Example:
-
- The column in the table has a value of, say, 25.
- Read the 25, and increment to 26 for the next person.(or
- increment to 26 and read 26). The largest int you can have
- is something like 2^32 so you should have unique numbers for
- awhile??
-
- Mark
-
-