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 the next ID. It has served me well for some time. I use this ID field for all references to record. End users have no direct access to this field and can not change it.Anyway, it relies on the single threading of the MacOS WebCatalog and that two simultaneous request to add a record won't create two records with the same 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 Advertising 58 E State Street Montpelier, VT 05602 802-229-4149 phil@signalz.com http://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:

    
  1. Re: generating unique IDs (Andrew Vernon 2000)
  2. Re: generating unique IDs (Nico 2000)
  3. generating unique IDs (Phil Marshall 2000)
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 the next ID. It has served me well for some time. I use this ID field for all references to record. End users have no direct access to this field and can not change it.Anyway, it relies on the single threading of the MacOS WebCatalog and that two simultaneous request to add a record won't create two records with the same 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 Advertising 58 E State Street Montpelier, VT 05602 802-229-4149 phil@signalz.com http://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:

TemplateCacheSize preference (1998) Field Problem (2000) Hotmail and HTML emails (2003) Format all of a sudden doesn't work (1997) Claris HomePage messes up the code (1997) Late on Friday.... brain fried (2002) Almost a there but..bye bye NetCloak (1997) WCS Newbie question (1997) RE: creating writefile data from a nested search (1997) Building Calendars (1997) consolidating orders (2000) why .HTML pages no processing? (2000) Quit revisited (1997) XML Woes (2004) Using Webcatalog to make a peer to peer tracker (2001) NT or Mac (1997) [OT] Visual Fox Pro vs. SQL (2005) WebCat2 - many [carts] on one template page? (1997) wierd [cart] action! (1997) WebCat2 beta 11 - new prefs ... (1997)