Re: Simple way to create unique SKU

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 11101
interpreted = N
texte = >This seemed really obvious after it occured to me. It may be helpful to >others. > >The WC2.0 site we're going to release in the next week or two includes a >database of used records (phonograph records) in which each is a unique >item. I needed a simple way to assign a unique SKU to each new item with >it being transparent to our customer. (Neither the customer or his >customers need to see the SKU's as there are other unique identifiers to >the merchandise, and he doesn't use them in his retail operation--the SKU's >really only need to be there for WC.) I started out working with Kenneth's >counter example, but then it dawned on me that time and date were easier >ways to implement this. > >Using sku=[DATE %y%j%H%M%S] on my template for adding items to the >catalog, I generate a unique number (such as 97132110236) that will not be >duplicated and that serves as a kind of time stamp as well. I considered >not using the year or seconds, but if something were to be added at the >same hour and minute of the same day of the year next year, or if two items >were added during the same minute, it could be a problem. > >Once we do our final debug on the site and release it, I'll upload to the >FTP site. We are using frames in what I think is a non-ugly >implementation, and are including some neat email functions and contextual >help that IMHO are pretty neat. Our customer has been amazed at the >blinding speed of WC.Just using [cart] creates a unique value too ... and it works even if two people happen to use the template at the very same second. That's what I've been using to create unique records on my site. The only potential problem comes when you reset the server's clock back, because then someone might be able to create a duplicate [cart] value ... since [cart] is based on the server's time, too.Sincerely, Ken Grome ..... ken@iav.com Associated Messages, from the most recent to the oldest:

    
  1. Re: Simple way to create unique SKU (Grant Hulbert 1997)
  2. Re: Simple way to create unique SKU (Kenneth Grome 1997)
  3. Simple way to create unique SKU (Ed Trefzger 1997)
>This seemed really obvious after it occured to me. It may be helpful to >others. > >The WC2.0 site we're going to release in the next week or two includes a >database of used records (phonograph records) in which each is a unique >item. I needed a simple way to assign a unique SKU to each new item with >it being transparent to our customer. (Neither the customer or his >customers need to see the SKU's as there are other unique identifiers to >the merchandise, and he doesn't use them in his retail operation--the SKU's >really only need to be there for WC.) I started out working with Kenneth's >counter example, but then it dawned on me that time and date were easier >ways to implement this. > >Using sku=[DATE %y%j%H%M%S] on my template for adding items to the >catalog, I generate a unique number (such as 97132110236) that will not be >duplicated and that serves as a kind of time stamp as well. I considered >not using the year or seconds, but if something were to be added at the >same hour and minute of the same day of the year next year, or if two items >were added during the same minute, it could be a problem. > >Once we do our final debug on the site and release it, I'll upload to the >FTP site. We are using frames in what I think is a non-ugly >implementation, and are including some neat email functions and contextual >help that IMHO are pretty neat. Our customer has been amazed at the >blinding speed of WC.Just using [cart] creates a unique value too ... and it works even if two people happen to use the template at the very same second. That's what I've been using to create unique records on my site. The only potential problem comes when you reset the server's clock back, because then someone might be able to create a duplicate [cart] value ... since [cart] is based on the server's time, too.Sincerely, Ken Grome ..... ken@iav.com 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:

creating a ShipCosts database (1997) 'does not contain' operator needed ... (1997) WC2.0 Memory Requirements (1997) Empty Shopping Carts? (1998) How to best sort in a pre-defined item-by-item order ... (2003) Hummm .... (2002) I'm having trouble using [url][interpret][math] together in lookup (1997) Running _every_ page through WebCat ? (1997) Searching multiple fields from one form field (1997) Old & New? (2003) Authorize.net, SIM, tcpconnect and applescript (2003) Web Calendar (2002) Associative lookup style? + bit more (1997) can WC render sites out? (1997) URGENT: WebDNA Server Not Running (2003) WebCat2_Mac RETURNs in .db (1997) upgrade? (1997) docs for WebCatalog2 (1997) search across ip/domain addresses? (1998) Friday brain fry (2001)