Re: Searching Relational Databases

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 55362
interpreted = N
texte = On 1/8/04 2:56 PM, "Alex McCombie" wrote: Justin, Just curious if this worked for you or got you started? I still havent had time to really test it, but it seemed solid. Alex > On 1/8/04 2:13 PM, "Justin Carroll" > wrote: > > Added a hideif to stop the duplicate entry on the secondary array when the > listwords index = 2 and the value is greater. > > I cant get to testing this anytime soon. > > Anyone else want to? > > > > > > >> We're using version 4.0.2 rc2 Thanks. > Of course in this scenario this could be solved by adding a field to the > business.db that contains a updated total employee count that would be > modified by the add/delete in the employee system.... > > BUT, assuming that you cant do that or since this is just an example you > could use the following complex logic. > > Search on the business.db on your criteria and return a results list that > just seeds your variables: > > > [Text]Businessrank=[/text] > [Text]Businesssku=[/text] > [Text]Busrerank=[/text] > > [search business.db&on something] > [founditems] > [text]indexvar=[index][/text] > > [search db=employee.db&eqbusiness_skudatarq=[sku]] > [showif [indexvar]=1] > [text]businessrank=[SKU]|[numfound]|[/text] > [/showif] > > [showif [indexvar]>1] > [text]totalvar=[CountWords Delimiters=|][businessrank][/countwords][/text] > > [listwords words=[businessrank] Delimiters=|] > > [showif [index]\2] > [showif [numfound]>[word]] > [text]busrerank=[sku]|numfound]|[busrerank][/text] > [/showif] > [showif [index]=[totalvar]] > [hideif [numfound]>[word]] > [text]busrerank=[busrerank]|[sku]|numfound]|[/text] > [/hideif] > [/showif] > [/showif] > > [/listwords] > > [listwords words=[busrerank] Delimiters=|] > [hideif [index]\2] > [Text]Businesssku=[businesssku]|[word][/text] > [/listwords] > > [/founditems] > [/search] > > > [listwords words=[businesssku] Delimiters=|] > [Lookup > db=business.db&value=[word]&lookInField=sku&returnField=business_name¬Fou > nd=] > > [/listwords] > > > > > > I believe this is fairly solid. It should give you a variable with the skus > to the business.db sorted from largest to smallest which you could then use > to do the lookups in order. > > Like I said, this is UNTESTED, but I believe the logic is fairly sound, give > or take a syntax error here or there... I just threw it together to get us > started. > > > Anyone? > > > Alex J McCombie New World Media > Chief Information Officer Box 124 > 888/892.6379 MartVille, NY 13111 > Alex@NewWorldMedia.com http://OurClients.com > > Interface Designer WebDNA Programmer Database Designer > > Alex J McCombie New World Media Chief Information Officer Box 124 888/892.6379 MartVille, NY 13111 Alex@NewWorldMedia.com http://OurClients.com Interface Designer WebDNA Programmer Database Designer ------------------------------------------------------------- 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: Searching Relational Databases ( Justin Carroll 2004)
  2. Re: Searching Relational Databases ( Justin Carroll 2004)
  3. Re: Searching Relational Databases ( Alex McCombie 2004)
  4. Re: Searching Relational Databases ( Alex McCombie 2004)
  5. Re: Searching Relational Databases ( Alex McCombie 2004)
  6. Re: Searching Relational Databases ( Alex McCombie 2004)
  7. Re: Searching Relational Databases ( Marc Kaiwi 2004)
  8. Re: Searching Relational Databases ( Justin Carroll 2004)
  9. Re: Searching Relational Databases ( Alex McCombie 2004)
  10. Re: Searching Relational Databases ( Marc Kaiwi 2004)
  11. Re: Searching Relational Databases ( Marc Kaiwi 2004)
  12. Searching Relational Databases ( Justin Carroll 2004)
On 1/8/04 2:56 PM, "Alex McCombie" wrote: Justin, Just curious if this worked for you or got you started? I still havent had time to really test it, but it seemed solid. Alex > On 1/8/04 2:13 PM, "Justin Carroll" > wrote: > > Added a hideif to stop the duplicate entry on the secondary array when the > listwords index = 2 and the value is greater. > > I cant get to testing this anytime soon. > > Anyone else want to? > > > > > > >> We're using version 4.0.2 rc2 Thanks. > Of course in this scenario this could be solved by adding a field to the > business.db that contains a updated total employee count that would be > modified by the add/delete in the employee system.... > > BUT, assuming that you cant do that or since this is just an example you > could use the following complex logic. > > Search on the business.db on your criteria and return a results list that > just seeds your variables: > > > [text]Businessrank=[/text] > [text]Businesssku=[/text] > [text]Busrerank=[/text] > > [search business.db&on something] > [founditems] > [text]indexvar=[index][/text] > > [search db=employee.db&eqbusiness_skudatarq=[sku]] > [showif [indexvar]=1] > [text]businessrank=[SKU]|[numfound]|[/text] > [/showif] > > [showif [indexvar]>1] > [text]totalvar=[CountWords Delimiters=|][businessrank][/countwords][/text] > > [listwords words=[businessrank] Delimiters=|] > > [showif [index]\2] > [showif [numfound]>[word]] > [text]busrerank=[sku]|numfound]|[busrerank][/text] > [/showif] > [showif [index]=[totalvar]] > [hideif [numfound]>[word]] > [text]busrerank=[busrerank]|[sku]|numfound]|[/text] > [/hideif] > [/showif] > [/showif] > > [/listwords] > > [listwords words=[busrerank] Delimiters=|] > [hideif [index]\2] > [text]Businesssku=[businesssku]|[word][/text] > [/listwords] > > [/founditems] > [/search] > > > [listwords words=[businesssku] Delimiters=|] > [Lookup > db=business.db&value=[word]&lookInField=sku&returnField=business_name¬Fou > nd=] > > [/listwords] > > > > > > I believe this is fairly solid. It should give you a variable with the skus > to the business.db sorted from largest to smallest which you could then use > to do the lookups in order. > > Like I said, this is UNTESTED, but I believe the logic is fairly sound, give > or take a syntax error here or there... I just threw it together to get us > started. > > > Anyone? > > > Alex J McCombie New World Media > Chief Information Officer Box 124 > 888/892.6379 MartVille, NY 13111 > Alex@NewWorldMedia.com http://OurClients.com > > Interface Designer WebDNA Programmer Database Designer > > Alex J McCombie New World Media Chief Information Officer Box 124 888/892.6379 MartVille, NY 13111 Alex@NewWorldMedia.com http://OurClients.com Interface Designer WebDNA Programmer Database Designer ------------------------------------------------------------- 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/ Alex McCombie

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:

Searching the same field with 2 form variables. (2000) Major bug report on rootbeer (1997) Next X hits (1996) ShipCosts database (1997) 2.0 Info (1997) Laying an egg. (1998) A Global Variable (1997) spaces in [texta] (1998) WebCatalog can't find database (1997) shownext (1997) 2.1 Stuff (1998) [GROUPS] followup (1997) update on wn searching (1997) inventory management (2000) webcat and OS 8 (1997) WebCat2b13MacPlugIn - [showif][search][/showif] (1997) Error.html (1997) WebCatalog NT beta 18 problem (1997) Setting up shop (1997) [math date] with non-US date format (2000)