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.dbrecord that client has access to.Thanks, Kenneth, for your suggestions. It works (of course ;-)for the access restriction. But it does not solve the secondproblem: when I search for the client I get a list of all hisproducts. In [founditems] I loop through the product-sku's ofthe client and find associated categories in products.db withlookups. But because WebCat has no string variables :-( I cannotskip double names within the loop and therefore can't get uniquevalues 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 allfound 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 valuesvia 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 aframe version and the category list is generated just once, whenthe 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 towrite it like this:[appendfile somefile]sometext[/appendfile](I use BBEdit 4.5)Peter__________________________________________Peter Ostry - po@ostry.com - www.ostry.comOstry & Partner - Ostry Internet SolutionsAuhofstrasse 29 A-1130 Vienna Austriafon ++43-1-8777454 fax ++43-1-8777454-21
Associated Messages, from the most recent to the oldest:
(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.dbrecord that client has access to.Thanks, Kenneth, for your suggestions. It works (of course ;-)for the access restriction. But it does not solve the secondproblem: when I search for the client I get a list of all hisproducts. In
[founditems] I loop through the product-sku's ofthe client and find associated categories in products.db withlookups. But because WebCat has no string variables :-( I cannotskip double names within the loop and therefore can't get uniquevalues 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 allfound 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 valuesvia 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 aframe version and the category list is generated just once, whenthe 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 towrite it like this:[appendfile somefile]sometext[/appendfile](I use BBEdit 4.5)Peter__________________________________________Peter Ostry - po@ostry.com - www.ostry.comOstry & Partner - Ostry Internet SolutionsAuhofstrasse 29 A-1130 Vienna Austriafon ++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:
Wanted: More Math Functions (or, Can You Solve This?) (1997)
Emailer port change (1997)
absolute paths for databases? (1997)
sort problems....bug or brain fart? (1997)
WebCat2 Append problem (B14Macacgi) (1997)
Execute Applescript (1997)
multiple search commands (1997)
getchars broken? (1997)
FEATURE REQUEST: (was: Summarizing results. Is there ashortcut? (1999)
WebCat2.0 [format thousands .0f] no go (1997)
Authenticating users without dialog box (1997)
Date math format (1998)
ServerQuestion (2000)
redirect with frames (1997)
international time (1997)
Understanding texta (1997)
restarting service remotely on NT (1997)
MySQL Wildcard Trouble (2006)
Purchase Plugin Missing (1996)
Location of Browser Info.txt file (1997)