Specifying the Command to Execute

From RAD Studio
Jump to: navigation, search

Go Up to Executing Commands That Do Not Return Records


With unidirectional datasets, the way you specify the command to execute is the same whether the command results in a dataset or not. That is:

When using Data.SqlExpr.TSQLDataSet, use the CommandType and CommandText properties to specify the command:

  • If CommandType is ctQuery, CommandText is the SQL statement to pass to the server.
  • If CommandType is ctStoredProc, CommandText is the name of a stored procedure to execute.

When using Data.SqlExpr.TSQLQuery, use the SQL property to specify the SQL statement to pass to the server.

When using Data.SqlExpr.TSQLStoredProc, use the StoredProcName property to specify the name of the stored procedure to execute.

Just as you specify the command in the same way as when you are retrieving records, you work with query parameters or stored procedure parameters the same way as with queries and stored procedures that return records.

See Also