Datasnap.Provider.TCustomProvider.ApplyUpdates

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function ApplyUpdates(const Delta: OleVariant; MaxErrors: Integer;  out ErrorCount: Integer): OleVariant; overload;
function ApplyUpdates(const Delta: OleVariant; MaxErrors: Integer;  out ErrorCount: Integer; var OwnerData: OleVariant): OleVariant; overload;

C++

System::OleVariant __fastcall ApplyUpdates(const System::OleVariant &Delta, int MaxErrors, /* out */ int &ErrorCount)/* overload */;
System::OleVariant __fastcall ApplyUpdates(const System::OleVariant &Delta, int MaxErrors, /* out */ int &ErrorCount, System::OleVariant &OwnerData)/* overload */;

Properties

Type Visibility Source Unit Parent
function public
Datasnap.Provider.pas
Datasnap.Provider.hpp
Datasnap.Provider TCustomProvider

Description

Applies updates received as a delta packet.

Call ApplyUpdates to apply updates contained in a delta packet. ApplyUpdates generates a BeforeApplyUpdates event, applies the updates, and then generates an AfterApplyUpdates event.

Specify the delta packet as the Delta parameter.

Use the MaxErrors parameter to indicate the maximum number of errors that can be applied before stopping the update operation. If MaxErrors is –1, the provider tries to apply all updates.

ErrorCount returns the number of errors encountered during the update operation.

The OwnerData parameter (if used) supplies custom information that is passed to the BeforeApplyUpdates event handler and which returns any information supplied by that event handler.

ApplyUpdates returns a data packet (as an OleVariant) of updates that could not be applied to the database.

Note: ApplyUpdates always generates the BeforeApplyUpdates and AfterApplyUpdates events, even if you use the syntax that does not include an OwnerData parameter. In that case, the value of OwnerData is nil (Delphi) or NULL (C++) on entry to the BeforeApplyUpdates event handler and is discarded on exit from the AfterApplyUpdates event handler.

Warning: The provider can't detect when an update conflicts with another user's changes to a memo field. This situation will not contribute to the errors counted by ErrorCount.

See Also