[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
[Properties (by Name)] [Methods (by Name)] [Events (by Name)]
A collection of parameter values for SQL-based datasets
Source position: db.pas line 1255
type TParams = class(TCollection) |
||
public |
||
constructor Create(); |
|
Create a new instance of TParams |
procedure AddParam(); |
|
Add a parameter to the collection |
procedure AssignValues(); |
|
Copy values from another collection |
function CreateParam(); |
|
Create and add a new parameter to the collection |
function FindParam(); |
|
Find a parameter with given name |
procedure GetParamList(); |
|
Fetch a list of TParam instances |
function IsEqual(); |
|
Is the list of parameters equal |
function GetEnumerator; |
|
Return an enumerator for the parameters |
function ParamByName(); |
|
Return a parameter by name |
function ParseSQL(); |
|
Parse SQL statement, replacing parameter names with SQL parameter placeholders |
procedure RemoveParam(); |
|
Remove a parameter from the collection |
procedure CopyParamValuesFromDataset(); |
|
Copy parameter values from the fields in a dataset. |
|
Dataset that owns the TParams instance |
|
|
Indexed access to TParams instances in the collection |
|
property ParamValues []: Variant; [rw] |
|
Named access to the parameter values. |
end; |
|
A collection of parameter values for SQL-based datasets |
|
| | ||
| | ||
| | ||
TParams is a collection of TParam values. It is used to specify parameter values for parametrized SQL statemens, but is also used to specify parameter values for stored procedures. Its default property is an array of TParam values. The class also offers a method to scan a SQL statement for parameter names and replace them with placeholders understood by the SQL engine: TParams.ParseSQL.
TDataset itself does not use TParams. The class is provided in the DB unit, so all TDataset descendents that need some kind of parametrization make use of the same interface. The TMasterParamsDataLink class can be used to establish a master-detail relationship between a parameter-aware TDataset instance and another dataset; it will automatically refresh parameter values when the fields in the master dataset change. To this end, the TParams.CopyParamValuesFromDataset method exists.
|
Base class for records-based data-access |
|
|
Class to establish a master-detail relationship between dataset, based on parameters |
|
|
Parameter description class |
|
|
Parse SQL statement, replacing parameter names with SQL parameter placeholders |
|
|
Copy parameter values from the fields in a dataset. |