FireDAC.Comp.DataSet.TFDDataSet.AddIndex
Delphi
procedure AddIndex(const AName, AFields, AExpression: string; AOptions: TFDSortOptions; const ADescFields: string = ''; const ACaseInsFields: string = ''; ADistinct: Boolean = False);
C++
void __fastcall AddIndex(const System::UnicodeString AName, const System::UnicodeString AFields, const System::UnicodeString AExpression, Firedac::Stan::Intf::TFDSortOptions AOptions, const System::UnicodeString ADescFields = System::UnicodeString(), const System::UnicodeString ACaseInsFields = System::UnicodeString(), bool ADistinct = false);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | FireDAC.Comp.DataSet.pas FireDAC.Comp.DataSet.hpp |
FireDAC.Comp.DataSet | TFDDataSet |
Description
Creates a new client index for the dataset.
Call AddIndex to create a new index for the client dataset.
This method corresponds to manually adding a new index to the Indexes property and setting the properties of the new index. If the index with the AName
name already exists, then an exception is raised.
The AField
and AExpression
properties are mutually exclusive. The new index will be active, but not current.
Parameters meaning:
AName
- A name of the new index.AFields
- A semicolon-delimited list of the fields to include in the index.AExpression
- A sorting expression.AOptions
- A set of additional options for the index.ADescFields
- A semicolon-delimited list of field names. UseADescFields
instead of aAOptions
value that includessoDescending
to create an index that is in ascending order on some fields and descending order on others. All fields named inADescFields
are sorted in descending order.ACaseInsFields
- A semicolon-delimited list of field names. UseACaseInsFields
instead of aAOptions
value that includessoNoCase
to create an index that is case-insensitive on some fields and case-sensitive on others. All fields named inACaseInsFields
are sorted without regard to case.ADistinct
- True, if you need to get only records with the distinctAFields
/AExpression
values. False, if you need to get all records. False is the default value.