IDAStoredProcedure
Overview
The IDAStoredProcedure interface represents the base components of any stored procedure: procedure name and function, which executes the stored procedure on the server.
The IDAStoredProcedure interface is used in the classes that represent the database driver. These classes use the IDAStoredProcedure interface to work with stored procedures.
Location
- Unit: uDAServerInterfaces.pas
- Ancestry: IDASQLCommand | IDAStoredProcedure
Dataset (declared in IDASQLCommand)
Access to the standard VCL TDataSet.
property Dataset: TDataSet read
DynamicWhere (declared in IDASQLCommand)
Implementation of Dynamic Where.
property DynamicWhere: TDAWhereBuilder read write
Execute safecall
Executes the stored procedure.
function Execute: Integer
GetStoredProcedureName safecall
Returns the stored procedure name.
function GetStoredProcedureName: string
Name (declared in IDASQLCommand)
Returns a human-readable name for the command. For commands obtained through a TDASchema component, this will be the name that the command (or data table) was defined under in Schema Modeler. When obtaining a command from an IDAConnection, the name can be specified in the call to NewCommand or NewDataset.
property Name: string read
OnAfterExecute (declared in IDASQLCommand)
Fires right after a command was executed.
property OnAfterExecute: TDAAfterExecuteCommandEvent read write
delegate: procedure OnAfterExecute(const Sender: IDASQLCommand; ActualSQL: string; ElapsedMilliseconds: Cardinal)
OnBeforeExecute (declared in IDASQLCommand)
Fires just before a command will be executed.
property OnBeforeExecute: TDABeforeExecuteCommandEvent read write
delegate: procedure OnBeforeExecute(const Sender: IDASQLCommand)
OnExecuteError (declared in IDASQLCommand)
Fires if error was present during execution of command.
property OnExecuteError: TDAExecuteCommandErrorEvent read write
delegate: procedure OnExecuteError(const Sender: IDASQLCommand; ActualSQL: string; Error: Exception)
ParamByName safecall (declared in IDASQLCommand)
Locates a specific parameter, based on its name. If no matching parameter is defined, an exception will be raised.
function ParamByName(const aName: string): TDAParam
Parameters:
- aName: name of the parameter
Params (declared in IDASQLCommand)
Provides access to the list of parameters defined for the command.
property Params: TDAParamCollection read
Prepared (declared in IDASQLCommand)
Specifies whether the SQL statement has been prepared for execution on the database (true) or not (false). Setting this property to true will automatically prepare the statement. Preparing statements on the database server allows for faster execution, especially if the statement will be executed multiple times, as the server will not need to re-parse the SQL text for every execution. Please refer to your database system's documentation for more information on preparing statements.
Note that changing the SQL or Where properties will automatically un-prepare the statement.
property Prepared: Boolean read write
RefreshParams safecall (declared in IDASQLCommand)
Refreshes the list of parameters defined for the command based on the actual parameter names found in the SQL statement and Where clause.
procedure RefreshParams
SetStoredProcedureName safecall
Sets the stored procedure name.
procedure SetStoredProcedureName(const Name: string)
Parameters:
- Name: stored procedure name.
SQL (declared in IDASQLCommand)
Defines the SQL statement to be executed.
property SQL: string read write
SQLContainsDynamicWhere safecall (declared in IDASQLCommand)
Checks if SQL contains Dynamic Where macros.
function SQLContainsDynamicWhere: Boolean
StoredProcedureName
Represents the stored procedure name.
property StoredProcedureName: string read write
Dataset (declared in IDASQLCommand)
Access to the standard VCL TDataSet.
property Dataset: TDataSet read
DynamicWhere (declared in IDASQLCommand)
Implementation of Dynamic Where.
property DynamicWhere: TDAWhereBuilder read write
Name (declared in IDASQLCommand)
Returns a human-readable name for the command. For commands obtained through a TDASchema component, this will be the name that the command (or data table) was defined under in Schema Modeler. When obtaining a command from an IDAConnection, the name can be specified in the call to NewCommand or NewDataset.
property Name: string read
Params (declared in IDASQLCommand)
Provides access to the list of parameters defined for the command.
property Params: TDAParamCollection read
Prepared (declared in IDASQLCommand)
Specifies whether the SQL statement has been prepared for execution on the database (true) or not (false). Setting this property to true will automatically prepare the statement. Preparing statements on the database server allows for faster execution, especially if the statement will be executed multiple times, as the server will not need to re-parse the SQL text for every execution. Please refer to your database system's documentation for more information on preparing statements.
Note that changing the SQL or Where properties will automatically un-prepare the statement.
property Prepared: Boolean read write
SQL (declared in IDASQLCommand)
Defines the SQL statement to be executed.
property SQL: string read write
StoredProcedureName
Represents the stored procedure name.
property StoredProcedureName: string read write
Execute safecall
Executes the stored procedure.
function Execute: Integer
GetStoredProcedureName safecall
Returns the stored procedure name.
function GetStoredProcedureName: string
ParamByName safecall (declared in IDASQLCommand)
Locates a specific parameter, based on its name. If no matching parameter is defined, an exception will be raised.
function ParamByName(const aName: string): TDAParam
Parameters:
- aName: name of the parameter
RefreshParams safecall (declared in IDASQLCommand)
Refreshes the list of parameters defined for the command based on the actual parameter names found in the SQL statement and Where clause.
procedure RefreshParams
SetStoredProcedureName safecall
Sets the stored procedure name.
procedure SetStoredProcedureName(const Name: string)
Parameters:
- Name: stored procedure name.
SQLContainsDynamicWhere safecall (declared in IDASQLCommand)
Checks if SQL contains Dynamic Where macros.
function SQLContainsDynamicWhere: Boolean
OnAfterExecute (declared in IDASQLCommand)
Fires right after a command was executed.
property OnAfterExecute: TDAAfterExecuteCommandEvent read write
delegate: procedure OnAfterExecute(const Sender: IDASQLCommand; ActualSQL: string; ElapsedMilliseconds: Cardinal)
OnBeforeExecute (declared in IDASQLCommand)
Fires just before a command will be executed.
property OnBeforeExecute: TDABeforeExecuteCommandEvent read write
delegate: procedure OnBeforeExecute(const Sender: IDASQLCommand)
OnExecuteError (declared in IDASQLCommand)
Fires if error was present during execution of command.
property OnExecuteError: TDAExecuteCommandErrorEvent read write
delegate: procedure OnExecuteError(const Sender: IDASQLCommand; ActualSQL: string; Error: Exception)