FireDAC.Stan.Option.TFDUpdateOptions.UpdateChangedFields

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property UpdateChangedFields: Boolean read GetUpdateChangedFields

C++

__property bool UpdateChangedFields = {read=GetUpdateChangedFields, write=SetUpdateChangedFields, stored=IsUCFS, default=1};

Properties

Type Visibility Source Unit Parent
property published
FireDAC.Stan.Option.pas
FireDAC.Stan.Option.hpp
FireDAC.Stan.Option TFDUpdateOptions

Description

Controls which fields to include in the UPDATE or INSERT command.

Use the UpdateChangedFields property to specify whether FireDAC should include all fields allowed for updating (False) or only changed fields (True) in the UPDATE SET (<field list>) or INSERT INTO (<field list>) commands. The default value is True

A field is allowed for updating, if it has ReadOnly = False, pfInUpdate in ProviderFlags. There are also other possible options for auto incremental fields. 

Setting UpdateChangedFields to True guarantees that:

  • Only not NULL fields will be included in the INSERT command.
  • Only changed by user/application fields will be included in the UPDATE command.

This allows you to minimize the generation of rollback information at database recovery/transaction. It also fires only table triggers for fields that have been changed. 

Setting UpdateChangedFields to False allows you to optimize the posting of updates for multiple records, as it does not require you to regenerate the updates posting command for each record. Consider to set FastUpdates to True.

See Also