FireDAC.Comp.DataSet.TFDAutoIncField.IdentityInsert

From RAD Studio API Documentation
Jump to: navigation, search

[–] Properties
Type: property
Visibility: published
Source:
FireDAC.Comp.DataSet.pas
FireDAC.Comp.DataSet.hpp
Unit: FireDAC.Comp.DataSet
Parent: TFDAutoIncField

Delphi

property IdentityInsert: Boolean read GetIdentityInsert

C++

__property bool IdentityInsert = {read=GetIdentityInsert, write=SetIdentityInsert, default=0};

Description

Enables the explicit assignment of a value to an autoincrementing column.

Set the IdentityInsert property to True to enable the explicit assignment of a value to an autoincrementing column. By default it is False. This is useful at first for data import batch operations.

Note: Not all DBMSs support assignment of a value to the identity columns.

When a DBMS supports sequences or generators and the application, on the client side, fills the field values from a sequence, then it is required to set IdentityInsert to True.

Example

TFDAutoIncField(FDQuery1.Fields[0]).IdentityInsert := True;
FDQuery1.Append;
FDQuery1.Fields[0].Value := 123;
FDQuery1.Post;

See Also