lookup

From Lazarus wiki
Revision as of 19:42, 14 December 2012 by BigChimp (talk | contribs) (Created page with "{{Translate}} == Definition == Unit: FreePascal, unit '''db''' <syntaxhighlight> function Lookup(const KeyFields: string; const KeyValues: Variant; const ResultFields: s...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Template:Translate

Definition

Unit: FreePascal, unit db

    function Lookup(const KeyFields: string; const KeyValues: Variant; const ResultFields: string): Variant;

Official documentation: none

Description

'lookup is similar to locate in that it looks for a record in the dataset where the specified search values for the specified fields match.

If found, the function returns a variant array with the values of the ResultFields (a semicolon-delimited list of desired fields). If not found, it returns Null. In neither case does it change the current physical record/cursor.

KeyFields can be a single field name or a semicolon-separated list of fields.

KeyValue can be a variant or a variant array and the number of items must match the number of fields specified in KeyFields.

Light bulb  Note: Lookup is only implemented in non-unidirectional datasets, i.e. you must be able to move back and forwards through the dataset.


See also

  • [1] Description of how to use lookup with Delphi