lookup — perform lookup in another database
The filter performs a lookup in another database.
See the section called “EXAMPLES” for clarification.
Example: Filter example
Suppose we have two databases, products and support, as follows:
code price description 144 12 Item 144 145 84 Item 145 146 314 Item 146
and
code product_supported 144 0 145 1 146 -1
Then, performing
[filter lookup.support.product_supported]144[/filter] would
yield 0.
Interchange 5.9.0:
Source: code/Filter/lookup.filter
Lines: 18
# Copyright 2002-2007 Interchange Development Group and others
# Copyright 1996-2002 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. See the LICENSE file for details.
#
# $Id: lookup.filter,v 1.4 2007-03-30 23:40:44 pajamian Exp $
CodeDef lookup Filter
CodeDef lookup Description DB lookup
CodeDef lookup Routine <<EOR
sub {
my ($val, $tag, $table, $column) = @_;
return tag_data($table, $column, $val) || $val;
}
EOR