RAD Studio VCL Reference
|
Represents a parameter that is passed to or from a command.
TAdoDbxParameter = class(DbParameter, ICloneable);
class TAdoDbxParameter : public DbParameter, public ICloneable;
Borland.Data.AdoDbxClientProvider
If you are using parameterized SQL or stored procedures, you can pass parameters to them using the TAdoDbxParameter class. The Direction property determines whether a parameter is an input parameter, an output parameter, or a return value. You can create a new instance of a TAdoDbxParameter object using the simple constructor syntax. You can also specify a number of overloaded values in the constructor.
The TAdoDbxParameter class is an implementation of the ADO.NET DbParameter class.
To pass runtime parameters for a parameterized SQL statement or stored procedure, use the TAdoDbxParameterCollection class. An empty TAdoDbxParameterCollection is returned by the TAdoDbxCommand.Parameters property. After successfully preparing the command, parameters are added to the TAdoDbxParameterCollection by calling the Add method and passing the parameter information such as name, datatype, precision, scale, size, and so on. You can use one of the overloaded Add methods or you can set individual TAdoDbxParameter properties such as Direction, Precision, Scale, DbType and Size.
Parameter names must be unique, and the parameters must be added to the TAdoDbxParameterCollection in the same order in which parameter markers appear in the SQL. The Direction property, by default, is set to ParameterDirection.Input. In the case of stored procedures, it can be set to Output, InputOutput, or ReturnValue . If the inout parameter is expected to return more data than the input, you should specify the Precision as a size large enough to hold the output data.
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|