Re: forming a SKU

This WebDNA talk-list message is from

1999


It keeps the original formatting.
numero = 23526
interpreted = N
texte = >>The only real safe sku would be >> >>[date %Y%m%d][time %h%m%s][showif >>[lastrandom]=[random]][math][random]+[random][/math][/showif][showif >>[lastrandom]![random][lastrandom][/showif][ordersku][productsku][sizeSKU][shapeS >>KU][colorSKU] > > >I disagree. >This will not work the way you think it will ... > >You have to remember that the [lastrandom] and [random] tags are relative to the thread they are called in, they have no connection with any other threads. Therefore, the same [random] and [lastrandom] values could theoretically be created at the exact same time in two or more completely separate threads. > >The most reliable and 'practical' way to create a unique SKU value across *all* active webcat threads is by using the [cart] tag. That's why WebCat's internal [cart] calculation code uses date, time *AND* a special 'index' value that's never used in two different threads to generate a guaranteed-unique [cart] value every time. > >If your goal is to create a unique SKU value that *also* has some code to indicate size, color, etc. the best solution is to use something like this: > >[cart][size][color][etc] > >Where the size, color, etc. values are simply *appended* to the end of the guaranteed-unique [cart] value.To follow up, I should probably say that your technique wouldn't be a problem if there's only one person authorized to use webcat to create new records, because then that one erson is using a single thread. But in that case, you wouldn't need the complicated code you've suggested either, because it's impossible for a single person on a single thread to create more than one new record per second if that person is doing it by posting one record at a time. In fact, a more realistic speed for creating new recordslike this would be one or two per minute -- so this may never become an issue anyways.Sincerely, Ken Grome Associated Messages, from the most recent to the oldest:

    
  1. Re: forming a SKU (Larry Hewitt 1999)
  2. Re: forming a SKU (Kenneth Grome 1999)
  3. Re: forming a SKU (Martin Bech 1999)
  4. Re: forming a SKU (Peter Ostry 1999)
  5. Re: forming a SKU (Joseph Pugh 1999)
  6. Re: forming a SKU (Martin Bech 1999)
  7. Re: forming a SKU (Kenneth Grome 1999)
  8. Re: forming a SKU (Kenneth Grome 1999)
  9. Re: forming a SKU (Jan Kinzler 1999)
  10. Re: forming a SKU (Joseph Pugh 1999)
  11. Re: forming a SKU (Martin Bech 1999)
  12. Re: forming a SKU (Joseph Pugh 1999)
  13. Re: forming a SKU (Peter Ostry 1999)
  14. Re: forming a SKU (Martin Bech 1999)
  15. Re: forming a SKU (Joseph Pugh 1999)
  16. Re: forming a SKU (Peter Ostry 1999)
  17. Re: forming a SKU (Joseph Pugh 1999)
  18. forming a SKU (Jan Kinzler 1999)
>>The only real safe sku would be >> >>[date %Y%m%d][time %h%m%s][showif >>[lastrandom]=[random]][math][random]+[random][/math][/showif][showif >>[lastrandom]![random][lastrandom][/showif][ordersku][productsku][sizeSKU][shapeS >>KU][colorSKU] > > >I disagree. >This will not work the way you think it will ... > >You have to remember that the [lastrandom] and [random] tags are relative to the thread they are called in, they have no connection with any other threads. Therefore, the same [random] and [lastrandom] values could theoretically be created at the exact same time in two or more completely separate threads. > >The most reliable and 'practical' way to create a unique SKU value across *all* active webcat threads is by using the [cart] tag. That's why WebCat's internal [cart] calculation code uses date, time *AND* a special 'index' value that's never used in two different threads to generate a guaranteed-unique [cart] value every time. > >If your goal is to create a unique SKU value that *also* has some code to indicate size, color, etc. the best solution is to use something like this: > >[cart][size][color][etc] > >Where the size, color, etc. values are simply *appended* to the end of the guaranteed-unique [cart] value.To follow up, I should probably say that your technique wouldn't be a problem if there's only one person authorized to use webcat to create new records, because then that one erson is using a single thread. But in that case, you wouldn't need the complicated code you've suggested either, because it's impossible for a single person on a single thread to create more than one new record per second if that person is doing it by posting one record at a time. In fact, a more realistic speed for creating new recordslike this would be one or two per minute -- so this may never become an issue anyways.Sincerely, Ken Grome Kenneth Grome

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:

Protect and Serve (1999) Search returns all, not 20 (1997) MATH (1998) Wierd thing in ViewOrder.tpl (1999) Authorize net woes (2003) Multiple download orders of the same product? (1997) Error -108 (1997) REPLACE & MAX/STARTAT parameters doesn't work? (2000) Digest for 4/18/97 (1997) Enhancement Request for WebCatalog-NT (1996) Grep -- remove extra returns first (2003) server 2003 weirdness (2004) Netscape v. IE (1997) could someone please try this - it's very quick and easy (2000) ListFiles Bug (1998) SSL with IIS 4.0 (1998) Playin Tricks (2006) Uh...can someone help me out with the b10? (1997) Sort Order on a page search (1997) Re:need help please (1997)