RAD Studio VCL Reference
|
Represents a SQL statement or stored procedure to execute against a data source.
TAdoDbxCommand = class(DbCommand, ICloneable);
class TAdoDbxCommand : public DbCommand, public ICloneable;
Borland.Data.AdoDbxClientProvider
Use the TAdoDbxCommand constructor to create a new instance of a TAdoDbxCommand object. The TAdoDbxCommand object is created automatically in your project when you create a TAdoDbxDataAdapter object. The TAdoDbxCommand object provides the means for executing SQL statements and stored procedures.
TAdoDbxCommand is an implementation of the .NET DbCommand class.
The CommandType property specifies whether a SQL statement, a table name, or a stored procedure name is being used in the CommandText property.
Depending on the type of SQL statement being executed, you can use one of the following methods:
To execute parameterized SQL, you can specify the CommandText values with parameter markers. The ? character is used as a parameter marker. Currently, there is no support for named parameters. During preparation, the database-specific provider implementation takes care of converting the ? parameter markers to database-specific parameter markers and also takes care of generating the appropriate SQL for calling a stored procedure.
When executing the same SQL repeatedly, call the Prepare method once and bind parameters. You specify parameters by adding a TAdoDbxParameter instance to the TAdoDbxCommand.Parameters property, which is a TAdoDbxParameterCollection. Preparing a parameterized SQL statement on most databases creates an execution plan on the server that is then used during subsequent execution of the same SQL with different parameter values.
Once the TAdoDbxCommand is complete, calling Dispose (or Free in Delphi) frees all of the statement resources allocated by the provider.
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|