FireDAC.Comp.Client.TFDUpdateSQL.Apply

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure Apply(ARequest: TFDUpdateRequest; var AAction: TFDErrorAction;
AOptions: TFDUpdateRowOptions); override;

C++

virtual void __fastcall Apply(Firedac::Stan::Option::TFDUpdateRequest ARequest, Firedac::Stan::Intf::TFDErrorAction &AAction, Firedac::Stan::Option::TFDUpdateRowOptions AOptions);

Properties

Type Visibility Source Unit Parent
procedure
function
public
FireDAC.Comp.Client.pas
FireDAC.Comp.Client.hpp
FireDAC.Comp.Client TFDUpdateSQL

Description

Applies a record update request to the DB for the current record in DataSet.

Call Apply to apply the changes of the current DataSet record to the database.

The standard implementation for TFDUpdateSQL sets the parameters for an SQL statement and executes it to update a record. ARequest indicates the update kind, and for TFDUpdateSQL it specifies which SQL statement to execute. If the appropriate SQL statement is not specified, then FireDAC will generate a default one, as it is doing when TFDAdaptedDataSet.UpdateObject is not specified.

Apply is primarily intended to manually execute the update statements from an OnUpdateRecord event handler. The ARequest, AAction, and AOptions argument values of the event handler must be assigned to the corresponding arguments of the Apply method.

ARequest can be one of the following values:

Value

Meaning

TFDUpdateSQL SQL property

arInsert

Inserts a record to the database.

InsertSQL

arUpdate

Update a record in the database.

ModifySQL

arDelete

Delete a record from the database.

DeleteSQL

arLock

Locks a record in the database.

LockSQL

arUnlock

Releases a record lock in the database.

UnlockSQL

arFetchRow

Refetches a record from the database.

FetchRowSQL

arUpdateHBlobs

Updates Oracle BLOB/CLOB values in the database.

-

arFetchGenerators

Fetches the generator values to include in the record.

-

AAction returns the completion status of the Apply method, specifying what action should take the calling code. Normally, this status is used by FireDAC code. When the Apply method is called from the OnUpdateRecord event handler, then assign the AAction argument of the event handler to the AAction argument of the Apply method. Otherwise, use eaDefault as the initial value.

AOptions specifies additional options. When the Apply method is called from the OnUpdateRecord event handler, then assign the AOptions argument of the event handler to the AOptions argument of the Apply method. Otherwise, use [] as a value.

See Also