generating unique IDs
This WebDNA talk-list message is from 2000
It keeps the original formatting.
numero = 30293
interpreted = N
texte = I've been using the following code to generate unique database record IDs:[text]lastID=[lookup db=file.db&value=0&lookinField=ID&returnField=X][/text][math show=F]nextID=[lastID]+1[/math][replace db=file.db&eqIDdata=0]X=[nextID][/replace]It assumes that a record with ID=0 exists and that a field X contains thenext ID. It has served me well for some time. I use this ID field for allreferences to record. End users have no direct access to this field and cannot change it.Anyway, it relies on the single threading of the MacOS WebCatalog and thattwo simultaneous request to add a record won't create two records with thesame ID.QUESTIONS: 1. Can I continue to assume this in my future on MacOS X?2. Is there a better way to create unique record IDs?Phil Marshall-- Signal Advertising58 E State StreetMontpelier, VT 05602802-229-4149phil@signalz.comhttp://www.signalz.com-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list
.To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to
Associated Messages, from the most recent to the oldest:
I've been using the following code to generate unique database record IDs:[text]lastID=[lookup db=file.db&value=0&lookinField=ID&returnField=X][/text][math show=F]nextID=[lastID]+1[/math][replace db=file.db&eqIDdata=0]X=[nextID][/replace]It assumes that a record with ID=0 exists and that a field X contains thenext ID. It has served me well for some time. I use this ID field for allreferences to record. End users have no direct access to this field and cannot change it.Anyway, it relies on the single threading of the MacOS WebCatalog and thattwo simultaneous request to add a record won't create two records with thesame ID.QUESTIONS: 1. Can I continue to assume this in my future on MacOS X?2. Is there a better way to create unique record IDs?Phil Marshall-- Signal Advertising58 E State StreetMontpelier, VT 05602802-229-4149phil@signalz.comhttp://www.signalz.com-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to
Phil Marshall
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
can WC render sites out? (1997)
syntax question, not in online refernce (1997)
Bug or syntax error on my part? (1997)
expire headers in mac305b11 (1999)
Exclamation point (1997)
Search (1997)
Likelihood of a duplicate (2005)
AppleScript/.db (was:FTP to WebStar) (2001)
Netscape Communicator 4 chops off URLs (was No Data) (1997)
Typhoon Rev. and PCS store problems (1999)
email formatting (1999)
available times? (2003)
RE: what characters are replaced for tab and CR? (1998)
Mondo amounts of Mail [long] (1999)
Unzip (2005)
problems with WebCat-Plugin ()
Big Databases (1997)
[WebDNA] Uploading Specific File Types (2009)
formulas.db (1999)
Opinion: [input] should be called [output] ... (1997)