How to best sort in a pre-defined item-by-item order ...

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 49722
interpreted = N
texte = I have two db's, a visitors.db and a products.db.I want to keep a list of a visitor's favorite products in the favorites field in his visitors.db record. My plan is to make this a comma-delimited list, and to store the sku of each favorite item in this field. But I do not want these skus stored randomly. Instead, I want them stored in the same order that the visitor wants to see them displayed when he clicks a link to View My Favorite Products.It's easy enough to store a bunch of comma-separated skus in the favorites field in a database record. And it's even easy to get WebDNA to store these skus in the specific order the visitor wants to see them when he views them in his browser. But ...If I'm going to perform a search in the products.db for the specific skus that appear in the favorites field of a visitors.db record, how do I make WebDNA sort the founditems in the order that the skus appear in my search parameters?Is this a case where I have to create a separate database, or a temporary database, just to get the founditems to appear in the specific item-by-item order I need?Or would a listwords loop with a bunch of lookups (or exact-match searches) be a better way to force the display into the proper order?Basically I'm looking for some theoretical (and hopefully some informed technical) answers to this problem -- answers that consider the relative performance hits of each proposed technique -- so I can select the technique that will produce fast results with the smallest performance hit to the WebDNA engine.I can see now that occasionally, such as in this situation, it would be really cool to be able to sort the founditems based on the order of the values as they appear in the search parameters. How hard would this be to add as a feature to WebDNA?I'm imagining a new set of parameter such as sortOrder=12,34,51,19,63,11,49&sortField=SKU ... which would tell WebDNA to sort the results in the order that the 'sortOrder' values appear when each of those comma-separated values is found in the 'SKU' field ... -- Sincerely, Kenneth Grome---------------------------------------------- Wholesale WebDNA programming only $27 an hour! ----------------------------------------------------------------------------------------------------------- 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 Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: How to best sort in a pre-defined item-by-item order ... (Kenneth Grome 2003)
  2. Re: How to best sort in a pre-defined item-by-item order ... (Alex McCombie 2003)
  3. Re: How to best sort in a pre-defined item-by-item order ... (John Peacock 2003)
  4. Re: How to best sort in a pre-defined item-by-item order ... (Alex McCombie 2003)
  5. Re: How to best sort in a pre-defined item-by-item order ... (John Peacock 2003)
  6. Re: How to best sort in a pre-defined item-by-item order ... (Alex McCombie 2003)
  7. Re: How to best sort in a pre-defined item-by-item order ... (Kenneth Grome 2003)
  8. Re: How to best sort in a pre-defined item-by-item order ... (Kenneth Grome 2003)
  9. Re: How to best sort in a pre-defined item-by-item order ... (Tim Robinson 2003)
  10. Re: How to best sort in a pre-defined item-by-item order ... (Kimberly D. Walls 2003)
  11. Re: How to best sort in a pre-defined item-by-item order ... (John Peacock 2003)
  12. How to best sort in a pre-defined item-by-item order ... (Kenneth Grome 2003)
I have two db's, a visitors.db and a products.db.I want to keep a list of a visitor's favorite products in the favorites field in his visitors.db record. My plan is to make this a comma-delimited list, and to store the sku of each favorite item in this field. But I do not want these skus stored randomly. Instead, I want them stored in the same order that the visitor wants to see them displayed when he clicks a link to View My Favorite Products.It's easy enough to store a bunch of comma-separated skus in the favorites field in a database record. And it's even easy to get WebDNA to store these skus in the specific order the visitor wants to see them when he views them in his browser. But ...If I'm going to perform a search in the products.db for the specific skus that appear in the favorites field of a visitors.db record, how do I make WebDNA sort the founditems in the order that the skus appear in my search parameters?Is this a case where I have to create a separate database, or a temporary database, just to get the founditems to appear in the specific item-by-item order I need?Or would a listwords loop with a bunch of lookups (or exact-match searches) be a better way to force the display into the proper order?Basically I'm looking for some theoretical (and hopefully some informed technical) answers to this problem -- answers that consider the relative performance hits of each proposed technique -- so I can select the technique that will produce fast results with the smallest performance hit to the WebDNA engine.I can see now that occasionally, such as in this situation, it would be really cool to be able to sort the founditems based on the order of the values as they appear in the search parameters. How hard would this be to add as a feature to WebDNA?I'm imagining a new set of parameter such as sortOrder=12,34,51,19,63,11,49&sortField=SKU ... which would tell WebDNA to sort the results in the order that the 'sortOrder' values appear when each of those comma-separated values is found in the 'SKU' field ... -- Sincerely, Kenneth Grome---------------------------------------------- Wholesale WebDNA programming only $27 an hour! ----------------------------------------------------------------------------------------------------------- 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 Web Archive of this list is at: http://webdna.smithmicro.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:

complete escaped ascii chart - importing and exporting filesquestion (1998) Database of Tax Rates? (1997) WebCat2b12 CGI Mac - [shownext] problem (1997) Hard Questions ? (1997) Summ=T Problem (1997) [OT] Trying to steal databases on our server (2003) Pithy questions on webcommerce & siteedit (1997) Getting total number of items ordered (1997) Showif for mulitple variations (1997) RE: Credit Card Checksum (1997) Help! WebCat install problems... (2000) Bug? (1997) WebDNA Intranet Edition release (2002) [WebDNA] How to set up new hosting (2013) japanese characters (1997) What's New In WebCatalog 3.0.7 (2000) Not really WebCat (1997) PCS Emailer's role ? (1997) Emailer (2005) VeriSign News (2002)