From RAD Studio API Documentation
Jump to: navigation, search


procedure AddIndex(const AName, AFields, AExpression: string; AOptions: TFDSortOptions;  const ADescFields: string = ''; const ACaseInsFields: string = ''; ADistinct: Boolean = False);


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);


Type Visibility Source Unit Parent
FireDAC.Comp.DataSet TFDDataSet


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. Use ADescFields instead of a AOptions value that includes soDescending to create an index that is in ascending order on some fields and descending order on others. All fields named in ADescFields are sorted in descending order.
  • ACaseInsFields - A semicolon-delimited list of field names. Use ACaseInsFields instead of a AOptions value that includes soNoCase to create an index that is case-insensitive on some fields and case-sensitive on others. All fields named in ACaseInsFields are sorted without regard to case.
  • ADistinct - True, if you need to get only records with the distinct AFields / AExpression values. False, if you need to get all records. False is the default value.

See Also