API:FireDAC.Comp.DataSet.TFDDataSet.Lookup

From RAD Studio API Documentation
Jump to: navigation, search

[–] Properties
Type: function
Visibility: public
Source:
FireDAC.Comp.DataSet.pas
FireDAC.Comp.DataSet.hpp
Unit: FireDAC.Comp.DataSet
Parent: TFDDataSet

Delphi

function Lookup(const AKeyFields: string; const AKeyValues: Variant;
const AResultFields: string): Variant; override;

C++

virtual System::Variant __fastcall Lookup(const System::UnicodeString AKeyFields, const System::Variant &AKeyValues, const System::UnicodeString AResultFields);

Description

Implements a virtual method to retrieve field values from a record that matches specified search values.

FireDAC.Comp.DataSet.TFDDataSet.Lookup inherits from Data.DB.TDataSet.Lookup. All content below this line refers to Data.DB.TDataSet.Lookup.

Implements a virtual method to retrieve field values from a record that matches specified search values.

This function:

Checks whether the dataset is unidirectional, and if so, raises an EDatabaseError exception.

Returns a Variant with the value false, indicating that a matching record was not found.

Descendant classes that are not unidirectional override this method so that it locates the record where the fields identified by the comma-delimited string KeyFields have the values specified by the Variant or Variant array KeyValues. In classes that implement Lookup, it returns a Variant or Variant array that contains the value or values of the fields specified by the comma-delimited string ResultFields on the specified record.

See Also