[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'DB' (#fcl)

# TFieldDef

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Class to describe one field in a record in a dataset

## Declaration

Source position: db.pas line 165

`type TFieldDef = class(TNamedItem)`
`public`
`constructor Create();` |  | Constructor for TFieldDef.
`destructor Destroy; override;` |  | Free the TFieldDef instance
`procedure Assign(); override;` |  | Assign the contents of one TFieldDef instance to another.
`function CreateField();` |  | Create TField instance based on definitions in current TFieldDef instance.
`property FieldClass: TFieldClass; [r]` |  | TField class used for this fielddef
`property FieldNo: LongInt; [r]` |  | Field number
`property CharSize: Word; [r]` |  | Character size
`property InternalCalcField: Boolean; [rw]` |  | Is this a definition of an internally calculated field ?
`property Required: Boolean; [rw]` |  | Is the field required ?
`property Codepage: TSystemCodePage; [r]` |  | System code page for the values in string and wide string field types
`published`
`property Attributes: TFieldAttributes; [rw]` |  | Additional attributes of the field.
`property DataType: TFieldType; [rw]` |  | Data type for the field
`property Precision: LongInt; [rw]` |  | Precision used in BCD (Binary Coded Decimal) fields
`property Size: Integer; [rw]` |  | Size of the buffer needed to store the data of the field
`end;`

## Inheritance

`TFieldDef` |  | Class to describe one field in a record in a dataset
`TNamedItem` |  | Named collection item
`TCollectionItem`
`TPersistent,IFPObserved`
`TObject`

## Description

TFieldDef is used to describe the fields that are present in the data underlying the dataset. For each field in the underlying field, an TFieldDef instance is created when the dataset is opened. This class offers almost no methods, it is mainly a storage class, to store all relevant properties of fields in a record (name, data type, size, required or not, etc.)

## See also

TDataset.FieldDefs |  | Definitions of available fields in the underlying database
TFieldDefs |  | Collection of TFieldDef instances.