RAD Studio |  |

Representing the Results of a Stored Procedure
See Also
Collapse All

Stored procedures are sets of SQL statements that are named and stored on an SQL server. How you indicate the stored procedure you want to execute depends on the type of unidirectional dataset you are using.

When using TSQLDataSet, to specify a stored procedure:

- Set the CommandType property to ctStoredProc.
- Specify the name of the stored procedure as the value of the CommandText property:

Copy Code

    SQLDataSet1.CommandType := ctStoredProc;
    SQLDataSet1.CommandText := 'MyStoredProcName';

Copy Code

    SQLDataSet1->CommandType = ctStoredProc;
    SQLDataSet1->CommandText = "MyStoredProcName";

When using TSQLStoredProc, you need only specify the name of the stored procedure as the value of the StoredProcName property.

Copy Code

    SQLStoredProc1.StoredProcName := 'MyStoredProcName';

Copy Code

    SQLStoredProc1->StoredProcName = "MyStoredProcName";

After you have identified a stored procedure, your application may need to enter values for any input parameters of the stored procedure or retrieve the values of output parameters after you execute the stored procedure. See Working with stored procedure parameters for information about working with stored procedure parameters.

See Also

Representing the Results of a Query

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!