Re: Searching multiple Databases
This WebDNA talk-list message is from 1997
It keeps the original formatting.
numero = 10445
interpreted = N
texte = >How do I perform a search on multiple databases in the same search?Depends on how you want the results presented. Putting 2 different [Search] contexts into the same template will cause all the results of 1 search to be displayed, then the results of the second:[Search db=somedb1&criteria=xx] [FoundItems]...[/FoundItems][/Search][Search db=somedb2&criteria=xx] [FoundItems]...[/FoundItems][/Search]Or if you want to look up some information from a second database while in the middle of [FoundItems] on the first, it may look like:[Search db=SomeDB1&criteria=xx] [FoundItems] [ZipCode] <-- this comes from somedb1 [Lookup db=SomeDB2&lookInField=ZipCode&value=[ZipCode]&returnField=State] [/FoundItems][/Search]The Lookup searches through someDB2 for a ZipCode that matches the [ZipCode] field from SomeDB1, and returns the corresponding State.The secret here is to nest searches within other searches, using [fields] from one database as search criteria for the interior searches.Grant Hulbert, V.P. Engineering | Tools for WebWarriorsPacific Coast Software | WebCatalog, WebCommerce Solution11770 Bernardo Plaza Court, #462 | SiteEdit, SiteCheck, PhotoMasterSan Diego, CA 92128 |619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com------------------------------------To leave this talk list send an email to macjordomo@smithmicro.comwith BODYunsubscribe WebDNA-Talk------------------------------------
Associated Messages, from the most recent to the oldest:
>How do I perform a search on multiple databases in the same search?Depends on how you want the results presented. Putting 2 different
[search] contexts into the same template will cause all the results of 1 search to be displayed, then the results of the second:[Search db=somedb1&criteria=xx]
[founditems]...[/FoundItems][/Search][Search db=somedb2&criteria=xx]
[founditems]...[/FoundItems][/Search]Or if you want to look up some information from a second database while in the middle of
[founditems] on the first, it may look like:[Search db=SomeDB1&criteria=xx]
[founditems] [ZipCode] <-- this comes from somedb1 [Lookup db=SomeDB2&lookInField=ZipCode&value=[ZipCode]&returnField=State] [/FoundItems][/Search]The Lookup searches through someDB2 for a ZipCode that matches the [ZipCode] field from SomeDB1, and returns the corresponding State.The secret here is to nest searches within other searches, using [fields] from one database as search criteria for the interior searches.Grant Hulbert, V.P. Engineering | Tools for WebWarriorsPacific Coast Software | WebCatalog, WebCommerce Solution11770 Bernardo Plaza Court, #462 | SiteEdit, SiteCheck, PhotoMasterSan Diego, CA 92128 |619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com------------------------------------To leave this
Talk List send an email to macjordomo@smithmicro.comwith BODYunsubscribe WebDNA-Talk------------------------------------
Grant Hulbert
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:
Text data with spaces in them... (1997)
'page impression' techniques for banner ads (1999)
Adding up line items. (2000)
OT: NT mac sharing (1998)
WebCat2 - [include] tags (1997)
Date problems-more (1997)
Error with [applescript] (1999)
Security for malls with different webmasters (1998)
well sort of - database design (2003)
target=_blank and form variables (1997)
all records returned. (1997)
A little syntax help (1997)
Just Testing (1997)
[SHOWIF]s and empty arguments (1997)
[shell] (2005)
Re:Emailer and encryption (1997)
purchase.log file (1997)
Re1000001: Setting up shop (1997)
delete a file? (1998)
Nesting FoundItem Context (1997)