Data.DB.TIndexDefs.GetIndexForFields

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function GetIndexForFields(const Fields: string;
CaseInsensitive: Boolean): TIndexDef;

C++

TIndexDef* __fastcall GetIndexForFields(const System::UnicodeString Fields, bool CaseInsensitive);

Properties

Type Visibility Source Unit Parent
function public
Data.DB.pas
Data.DB.hpp
Data.DB TIndexDefs

Description

Locates an index definition in the Items array.

Use GetIndexForFields to search for the index that starts with the fields specified in the Fields parameter. If more than one field comprises the index, separate the fields with semicolons. Set the CaseInsensitive parameter to true to restrict the search to only the case insensitive indexes in the Items array.

GetIndexForFields returns the index definition that exactly matches the specified fields in the order specified, if it exists. If no exact match is found, GetIndexForFields returns the first index that begins with the indicated fields. If no match can be found, GetIndexForFields returns nil (Delphi) or NULL (C++).

Note: When CaseInsensitive is true, descending indexes are considered even if they are case-sensitive.

See Also