Datasnap.Provider.TCustomProvider.Execute

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure Execute(const CommandText: OleStr; var Params,  OwnerData: OleVariant); virtual;

C++

virtual void __fastcall Execute(const System::WideString CommandText, System::OleVariant &Params, System::OleVariant &OwnerData);

Properties

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

Description

Executes a query, stored procedure, or custom SQL statement.

Client datasets call Execute through the AS_Execute method of the IAppServer interface. In response, the provider executes an SQL command. If the provider represents a query or stored procedure that does not return a cursor, calling Execute causes the provider to execute the query or stored procedure. If the caller supplies a value for CommandText, Execute may execute that statement instead (see below).

Before executing the appropriate command, Execute generates a BeforeExecute event. After executing the command, it generates an AfterExecute event. Finally, it returns any output parameters as the value of the Params parameter.

CommandText is an SQL statement that replaces the SQL of an associated query, or the name of a stored procedure that replaces the associated stored procedure. This parameter is ignored if the Options property does not include poAllowCommandText.

On entry, Params supplies parameter values for the query, stored procedure, or CommandText string. On exit, Params returns any output parameters.

OwnerData contains custom information passed to the provider from the client dataset's BeforeExecute event handler. This information is passed in to the provider's BeforeExecute event handler and is returned by the provider's AfterExecute event handler.

See Also