lookup

Using [lookup] in your template performs an extremely fast search through the specified database and returns either the value of the returnField in the found record, or the literal text of the notFound value. The search is a case-sensitive, exact match, so "Apple" does not equal "apple." If you want more control over the search criteria, use a [search] context instead.

[lookup db=mydata.db&value=46283&lookinfield=PROD_ID&returnfield=PROD_NAME&notfound=We do not have this product]

Parameters

ParameterDescription
dbPath and name of the databse
valueThe reference value
lookinfieldThe field to match the reference value
returnfieldThe value of the field that is required
notfoundA message or value or further WebDNA code to use if the 'value' is not found

You can specifiy a WebDNA table, in place of a database file.
ie: [lookup table=TableName&...].


[lookup] is about 40 times faster than [search]. Using several [lookup] to recover data from your databases may be faster than a single [search]