Datasnap.DBClient.TCustomClientDataSet.Lookup
Delphi
function Lookup(const KeyFields: string; const KeyValues: Variant; const ResultFields: string): Variant; override;
C++
virtual System::Variant __fastcall Lookup(const System::UnicodeString KeyFields, const System::Variant &KeyValues, const System::UnicodeString ResultFields);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | Datasnap.DBClient.pas Datasnap.DBClient.hpp |
Datasnap.DBClient | TCustomClientDataSet |
Description
Retrieves field values from a record that matches specified search values.
Call Lookup to retrieve values for specified fields from a record that matches search criteria. KeyFields
is a string containing a semicolon-delimited list of field names on which to search.
KeyValues
is a Variant containing the values to match in the key fields. To specify multiple search values, pass KeyValues
as a variant array as an argument, or, in Delphi, construct a variant array on the fly using the VarArrayOf routine. For example (C++):
Variant locvalues[2];
locvalues[0] = Variant("Sight Diver");
locvalues[1] = Variant("Kato Paphos");
Variant LookupResults = CustTable->Lookup("Company;City", VarArrayOf(locvalues, 1), "Company;Addr1;Addr2;State;Zip");
ResultFields
is a string containing a semicolon-delimited list of field names whose values should be returned from the matching record.
Lookup returns a variant array containing the values from the fields specified in ResultFields
.