TAstaClientDataSet.StoredProcedure
Applies to
TAstaClientDataSet
Declaration
property
StoredProcedure: string;
Description
The StoredProcedure property allows you to select predefined StoredProcs.
When a Stored Procedure is selected, the SQL and TableName properities will be cleared and the Params
will automatically populate based on the database stored procedure definition.
AstaClientDataSets automatically create a parameters list when stored procedures are used. To use a stored procedure, make sure that the ASTA server that you are connected to is connected to a database that supports stored procedures. The DBDemos Paradox/Dbase alias that comes with Delphi does not support stored procedures.
The StoredProcedure property in an AstaClientDataSet is a pulldown property that queries the server metadata to retrieve a list of the stored procedures available. When you choose a stored procedure, the column names and additional information (datatype, input/output) is then fetched to enable ASTA to auto create a parameter list. This allows remote developers to use a stored procedure created on a database across the world, the moment after it was created and to transmit the parameter information to ASTA at design time!
When a stored procedure returns a result set when executed, the data will populate the TAstaClientDataSet. Any result parameters will be returned in the TAstaParamList. Stored procedures can be used at run time by calling the Prepare method after you change the StoredProcedure name so that ASTA can create the parameters for that stored procedure.
If your StoredProcedure does not return a result set then call ExecSQL. Calling ExecSQL with a the StoredProcedure property set to to a valid StoredProcedure name adds an soExecStoredProc to the SQLOptions of the AstaClientDataSet.SQLOptions property which is transmitted to the AstaServer so that the OnStoredProcedure event of the AstaServerSocket can be called with the NoResultSet:Boolean set to true. Setting the AstaClientDataSet.Active to true with the soExecStoredProc property set is equivalent to calling ExecSQL.