Parameter Object
A Parameter object holds the values of specific parameters for a parameterized Command object. In other words, if a given SQL statement or other command takes a given set of parameters that change each time you execute the command, a Parameter object can be used to hold those parameters' values.
Each instantiated Command Object has a Parameters collection to which you can add parameters.
In addition to holding parameters of a straight SQL statement, a Parameter object can also represent the in/out or return values of a stored procedure.
Table 12.13. Parameter Object Properties
|
Property |
Description |
|---|---|
|
Attributes |
Sets or determines whether a given parameter will accept various data, such as signed values, null values, or long values. |
|
Direction |
Reflects whether the parameter represents an input parameter, an output parameter, or both. |
|
Name |
The name of the parameter, if it has one. |
|
NumericScale |
The number of decimal places to which numeric values will be resolved. The data type of this property is Byte. |
|
Precision |
The number of significant digits to which numeric values will be resolved. The data type of this property is Byte. |
|
Size |
A Long representing the maximum number of bytes or characters valid for the Parameter object. |
|
Type |
An integer that represents the data type of the parameter's contents. For the Parameter object, this is a read/write property. |
|
Value |
The actual value of the contents of the parameter. |
Table 12.14. Parameter Object Collections ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access