home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / database / sybase / 4 < prev    next >
Encoding:
Internet Message Format  |  1992-09-14  |  1.5 KB

  1. Path: sparky!uunet!cs.utexas.edu!bcm!mparsons
  2. From: mparsons@fleming.csc.bcm.tmc.edu (Mark Parsons)
  3. Newsgroups: comp.databases.sybase
  4. Subject: Re: Sequencer or Serial
  5. Message-ID: <14821@gazette.bcm.tmc.edu>
  6. Date: 14 Sep 1992 20:05:50 GMT
  7. References: <howard.716498215@judy.cs.iastate.edu>
  8. Sender: usenet@bcm.tmc.edu
  9. Reply-To: mparsons@fleming.csc.bcm.tmc.edu (Mark Parsons)
  10. Organization: Baylor College of Medicine, Houston, Tx
  11. Lines: 29
  12. Nntp-Posting-Host: fleming.csc.bcm.tmc.edu
  13. Originator: mparsons@fleming.csc.bcm.tmc.edu
  14.  
  15.  
  16. In article <howard.716498215@judy.cs.iastate.edu>, howard@cs.iastate.edu (Chris howard) writes:
  17. |> We need some help in discovering the most appropriate way
  18. |> to achieve a non-repeating unique item number, like
  19. |> the Sequencer facility in  Oracle, or the Serial datatype
  20. |> in Informix.
  21.  
  22.  
  23. I don't know what Informix does, and this may be oversimplified
  24. for what you need . . . 
  25.  
  26. Why not set up one table, with one column of type int.  Lock
  27. the table when accessing/updating it.  The idea is that this
  28. column will hold a counter . . . just increment the column
  29. each time you read the number . . 
  30.  
  31. Or as someone mentioned here in the past day or two, increment
  32. and then read it to cut down on possiblities of deadlock?
  33.  
  34. Example:
  35.  
  36.     The column in the table has a value of, say, 25.  
  37. Read the 25, and increment to 26 for the next person.(or
  38. increment to 26 and read 26).  The largest int you can have
  39. is something like 2^32 so you should have unique numbers for
  40. awhile??
  41.  
  42. Mark
  43.  
  44.