From RAD Studio API Documentation
Jump to: navigation, search



TSQLStoredProc = class(TCustomSQLDataSet)


class PASCALIMPLEMENTATION TSQLStoredProc : public TCustomSQLDataSet


Type Visibility Source Unit Parent
class public
Data.SqlExpr Data.SqlExpr


TSQLStoredProc represents a stored procedure that is executed using dbExpress.

Use TSQLStoredProc to execute a stored procedure on a database server that is accessed through TSQLConnection. TSQLStoredProc can represent the result set if the stored procedure returns a cursor. You can add a TSQLStoredProc component to a form or data module at design time, or create one dynamically at run time.

TSQLStoredProc is a unidirectional dataset. Unlike other datasets, unidirectional datasets do not buffer multiple records in memory. Because of this, you can only navigate using the First and Next methods. There is no built-in editing support; you can only edit the data in an SQL stored procedure by explicitly creating an SQL UPDATE command or by connecting the dataset to a client dataset, using a provider. Features that require buffering multiple records such as filters or lookup fields are not available.

Before you can use a TSQLStoredProc component, it must be connected to the database server. Therefore, the first step to take when working with TSQLStoredProc is to set the SQLConnection property. Once the dataset is connected to a server, use the StoredProcName property to specify the stored procedure to execute.

You can read the stored procedure result code for SQL Server and Sybase if you change the ParamCheck value to False. In this case, you need to take complete control over the parameters list and set them to match the stored procedure signature. The result code parameter must be set as the first in the list, and must be of type ptResult.

See Also