Re: many-to-one problem

This WebDNA talk-list message is from

1998


It keeps the original formatting.
numero = 17190
interpreted = N
texte = (Kenneth Grome:) >1- Create a Products.db with ALL your products >... >2- Create a Clients.db >... >3- Create one record in the Clients.db for EACH Product.db record that client has access to. Thanks, Kenneth, for your suggestions. It works (of course ;-) for the access restriction. But it does not solve the second problem: when I search for the client I get a list of all his products. In [founditems] I loop through the product-sku's of the client and find associated categories in products.db with lookups. But because WebCat has no string variables :-( I cannot skip double names within the loop and therefore can't get unique values for a category list:search clients.db for username [founditems] lookup products.db for SKU, return CATEGORY [/founditems] [/search]This returns a list of all categories, but with dup names.--------------------I solved this finally with a temporary database. I write all found categories into a temporary database file:search clients.db for username writefile: temp.db appendfile temp.db: SKU CATEGORY [founditems] appendfile temp.db: lookup products.db for SKU, return CATEGORY [/founditems] [/search]And now I search the created temp.db and get my unique values via the CATEGORYsumm command:search temp.db with CATEGORYsumm=t [founditems] [CATEGORY]
[/founditems] [/search] [closedatabase temp.db]That's it! This method is fast enough for my application since it is a frame version and the category list is generated just once, when the clients logs in.--------------------BTW - I discovered some strange behavior: [appendfile somefile]sometext[/appendfile] does not put a carriage return at the end of the line, I have to write it like this: [appendfile somefile]sometext [/appendfile] (I use BBEdit 4.5)Peter__________________________________________ Peter Ostry - po@ostry.com - www.ostry.com Ostry & Partner - Ostry Internet Solutions Auhofstrasse 29 A-1130 Vienna Austria fon ++43-1-8777454 fax ++43-1-8777454-21 Associated Messages, from the most recent to the oldest:

    
  1. Re: many-to-one problem (Kenneth Grome 1998)
  2. Re: many-to-one problem (Peter Ostry 1998)
  3. Re: many-to-one problem (PCS Technical Support 1998)
  4. Re: many-to-one problem (Kenneth Grome 1998)
  5. Re: many-to-one problem (Peter Ostry 1998)
  6. Re: many-to-one problem (Kenneth Grome 1998)
  7. Re: many-to-one problem (Peter Ostry 1998)
  8. Re: many-to-one problem (Kenneth Grome 1998)
  9. Re: many-to-one problem (Peter Ostry 1998)
  10. Re: many-to-one problem (Kenneth Grome 1998)
  11. many-to-one problem (Peter Ostry 1998)
(Kenneth Grome:) >1- Create a Products.db with ALL your products >... >2- Create a Clients.db >... >3- Create one record in the Clients.db for EACH Product.db record that client has access to. Thanks, Kenneth, for your suggestions. It works (of course ;-) for the access restriction. But it does not solve the second problem: when I search for the client I get a list of all his products. In [founditems] I loop through the product-sku's of the client and find associated categories in products.db with lookups. But because WebCat has no string variables :-( I cannot skip double names within the loop and therefore can't get unique values for a category list:search clients.db for username [founditems] lookup products.db for SKU, return CATEGORY [/founditems] [/search]This returns a list of all categories, but with dup names.--------------------I solved this finally with a temporary database. I write all found categories into a temporary database file:search clients.db for username writefile: temp.db appendfile temp.db: SKU CATEGORY [founditems] appendfile temp.db: lookup products.db for SKU, return CATEGORY [/founditems] [/search]And now I search the created temp.db and get my unique values via the CATEGORYsumm command:search temp.db with CATEGORYsumm=t [founditems] [CATEGORY]
[/founditems] [/search] [closedatabase temp.db]That's it! This method is fast enough for my application since it is a frame version and the category list is generated just once, when the clients logs in.--------------------BTW - I discovered some strange behavior: [appendfile somefile]sometext[/appendfile] does not put a carriage return at the end of the line, I have to write it like this: [appendfile somefile]sometext [/appendfile] (I use BBEdit 4.5)Peter__________________________________________ Peter Ostry - po@ostry.com - www.ostry.com Ostry & Partner - Ostry Internet Solutions Auhofstrasse 29 A-1130 Vienna Austria fon ++43-1-8777454 fax ++43-1-8777454-21 Peter Ostry

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:

quantity minimum problem (1997) [WebDNA] Email time bug? (2011) Initiating NewCart (1997) Redirect frame targets (1998) virtual virtual hosted store.... (1998) [WebDNA] Poll: Discussion Forum (2009) Price + Texte (1999) Secure Server (1997) WebCat2: multiple currency support (1997) [isfolder] and [filename] (1997) taxTotal confusion (1998) WebCatalog-NT?'s (1996) Re1000001: Setting up shop (1997) RE: [WebDNA] Bug in WebDNA or in my brain? (2013) MORE: Can I determine where they are coming from? (2000) RePost: NAT and the CART (1999) math a various prices (1997) displaying New products (using [date]) (1997) Help! WebCat2 bug (1997) format_to_days on NT (1997)