Data.DB.TIndexDefs.AddIndexDef
Delphi
function AddIndexDef: TIndexDef;
C++
TIndexDef* __fastcall AddIndexDef();
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | Data.DB.pas Data.DB.hpp |
Data.DB | TIndexDefs |
Description
Creates a new index definition object and adds it to the Items property.
Call AddIndexDef to add index definitions when creating a database table. AddIndexDef returns the new TIndexDef object that was added to the IndexDefs collection of index definitions. After calling AddIndexDef, set the properties of the newly added TIndexDef object to specify the name, type, and options of index that will be created.
Note: AddIndexDef is only valid in the context of creating index definitions for a table to be created with a subsequent call to the CreateTable or CreateDataSet method. It cannot be used to add indexes to an already-existing table.
See Also