FireDAC.Stan.Option.TFDBottomUpdateOptions.KeyFields

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property KeyFields: String read FKeyFields write SetKeyFields;

C++

__property System::UnicodeString KeyFields = {read=FKeyFields, write=SetKeyFields};

Properties

Type Visibility Source Unit Parent
property published
FireDAC.Stan.Option.pas
FireDAC.Stan.Option.hpp
FireDAC.Stan.Option TFDBottomUpdateOptions

Description

Specifies dataset primary key fields.

Use KeyFields to specify ';' separated list of fields, which represent primary keys for dataset records. The names must be without quotes and must match to the original result set field names. KeyFields must be specified before preparing/opening a dataset. 

Specifying KeyFields is required if FireDAC cannot determine primary key fields, when:

  • fiMeta is not included into Items, for example to raise the performance.
  • The application needs to edit a result set obtained from a view, tables join or a table without defined primary key.
  • The application needs to edit a result set obtained from a stored procedure or from other non-SELECT SQL construction.

Setting KeyFields removes pfInKey from all TField.ProviderFlags fields and includes pfInKey for the specified ProviderFlags fields. Alternatively, the application can use only pfInKey and TField.ProviderFlags, but not both simultaneously. 

To build a record search condition, use the following fields:

  • When posting a record update using UPDATE ... WHERE <record search condition>, if UpdateMode = upWhereKeyOnly or upWhereChanged.
  • When refreshing a record using SELECT ... WHERE <record search condition>.

See Also