many-to-one problem
This WebDNA talk-list message is from 1998
It keeps the original formatting.
numero = 17128
interpreted = N
texte = I have to setup a shop with one single product db and multiple client db's.I need one main-database forSKU, ProductID, Category, Type, Description, HasPhoto, Photo,and many databases (one for each client) withSKU, ProductID, ItemPrice, Unit, UnitPrice.The clue is to let our customer upload price-lists for his clients withdifferent selections of ProductID's and individually units and prices andmaintaining just one db with the actual product information.Starting point for each client is a sorted category-list with unique names.And there is the problem:I step through ProductID's of the client_x.db and find each associatedCategory in the product.db with a lookup. Then, of course, I get all foundcategories and not unique names...I tried to solve this problem by filtering out dup names with variables:I want set a variable oldcat to the found Category and a variablenewcat to the new found Category. If the two match, skip that line...----------[search ...] (process all ProductID's in client_x.db)[interpret]oldcat=[/interpret] (initialize variable)[founditems][interpret]newcat=[lookup ...][/interpret] (get Category in product.db)[hideif [[newcat]=[oldcat]]] (skip, if they match)[Category]
[/hideif][interpret][newcat]=[oldcat][/interpret] (prepare for the next loop)[/founditems][/search]----------I know, this use of [interpret] is nonsense, but how can I set a stringvariable?I manage to set variables with [math] but not with a string.Am I completely wrong with this database design for WebCat?If I put all stuff in one database I would get up to 200 fields. Or I putat least all clients names into the product database to have aclient_x_HasProduct field, or duplicate the categories in the clients,which I don't like either...I could even write a setup program which combines all databases to a hugesingle one after something changes - please, donīt tell me that ;-)TIA,Peter__________________________________________ Peter OstryOstry & Partner - Ostry Internet SolutionsAuhofstrasse 29 A-1130 Vienna Austriafon ++43-1-877 74 54 fax ++43-1-877 74 54po@ostry.com _______________ www.ostry.com
Associated Messages, from the most recent to the oldest:
I have to setup a shop with one single product db and multiple client db's.I need one main-database forSKU, ProductID, Category, Type, Description, HasPhoto, Photo,and many databases (one for each client) withSKU, ProductID, ItemPrice, Unit, UnitPrice.The clue is to let our customer upload price-lists for his clients withdifferent selections of ProductID's and individually units and prices andmaintaining just one db with the actual product information.Starting point for each client is a sorted category-list with unique names.And there is the problem:I step through ProductID's of the client_x.db and find each associatedCategory in the product.db with a lookup. Then, of course, I get all foundcategories and not unique names...I tried to solve this problem by filtering out dup names with variables:I want set a variable oldcat to the found Category and a variablenewcat to the new found Category. If the two match, skip that line...----------[search ...] (process all ProductID's in client_x.db)
[interpret]oldcat=[/interpret] (initialize variable)
[founditems][interpret]newcat=[lookup ...][/interpret] (get Category in product.db)[hideif [[newcat]=[oldcat]]] (skip, if they match)[Category]
[/hideif]
[interpret][newcat]=[oldcat][/interpret] (prepare for the next loop)[/founditems][/search]----------I know, this use of
[interpret] is nonsense, but how can I set a stringvariable?I manage to set variables with
[math] but not with a string.Am I completely wrong with this database design for WebCat?If I put all stuff in one database I would get up to 200 fields. Or I putat least all clients names into the product database to have aclient_x_HasProduct field, or duplicate the categories in the clients,which I don't like either...I could even write a setup program which combines all databases to a hugesingle one after something changes - please, donīt tell me that ;-)TIA,Peter__________________________________________ Peter OstryOstry & Partner - Ostry Internet SolutionsAuhofstrasse 29 A-1130 Vienna Austriafon ++43-1-877 74 54 fax ++43-1-877 74 54po@ostry.com _______________ www.ostry.com
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:
auto-stripping of spaces (1997)
Random Command (1997)
change the number format (1997)
Here we go again... (2006)
expiring a cookie each thursday (2000)
Snake Bites (1997)
Re:no [search] with NT (1997)
too many nested tags ... (1997)
[WebDNA] how to purge webdna cache of templates? (2009)
Help with Shipping Costs (1997)
placement of ? (2000)
Access to shopping cart files (2005)
[WebDNA] need to contact Greg Scott (2010)
Formulas.db + Users.db (1997)
Hiding the URL(was Cart ID Duplication) (2001)
WebCat2b13MacPlugIn - [shownext method=post] ??? (1997)
RE: Formulas.db + Users.db (1997)
Time Display from Database (1997)
WebCat2 Append problem (B14Macacgi) (1997)
WebCat2b13MacPlugin - [math][date][/math] problem (1997)