DBLOOKUP2

Description

Searches two columns of a database table for a value and returns the corresponding value from another column in the same row. Similar to the DBLOOKUP function, except that it accepts two lookup values and fields.

Syntax

DBLOOKUP2 ( SourceField1, SourceField2, "connection", "table", "lookup_field1", "lookup_field2", "substitution_field" )

Parameter Description
SourceField1 The value for which to search in the lookup_field1 column.
SourceField2 The value for which to search in the lookup_field2 column.
connection The connection where this lookup table resides.

If the connection is Scribe Internal Database, the SCRIBE user must have at least SELECT privileges on the lookup table.
table The name of the lookup table.
lookup_field1 The name of the column in the lookup table that stores the first value to search for.
lookup_field2 The name of the column in the lookup table that stores the second value to search for.
substitution_field The name of the column in the lookup table that stores the value to return.

Remarks

Note: This function requires special handling when working with bulk operations. See Using Bulk Operations for more information.

Useful for substituting full values for codes or vice versa.

To optimize performance, if DBLOOKUP2 is called again with the same parameters, it returns the same result (without performing another lookup).

See also

DBLOOKUP

DBLOOKUPCached

FILELOOKUP

FKEYSUBST