RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomProvider.Execute Method

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

Pascal
procedure Execute(const CommandText: WideString; var Params: OleVariant; var OwnerData: OleVariant); virtual;
C++
virtual __fastcall Execute(const BSTR CommandText, OleVariant Params, OleVariant OwnerData);

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. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!