TParams class
A collection of parameter values for SQL-based datasets.
Declaration
TParams = class(TCollection)Inheritance
Descends from it: TSQLDBParams
Description
TParams is a collection of
TParam values. It is used to specify parameter values for parameterized SQL statements,
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:
ParseSQL.
TDataset itself does not use
TParams. The class is provided in the
DB unit, so all
TDataset
descendents that need some kind of parameterization 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
CopyParamValuesFromDataset method
exists.
See also
Properties
Dataset | public | Dataset that owns the TParams instance. |
Items | public | Indexed access to TParams instances in the collection. |
ParamValues | public | Named access to the parameter values. |
Methods
CreateParseOpts | protected | |
DoParseSQL | protected | |
AssignTo | protected | Generic assignment function. |
GetDataSet | protected | |
GetOwner | protected | Returns the owner of the component. |
ParamClass | protected | |
Create | public | Create a new instance of TParams. |
AddParam | public | Add a parameter to the collection. |
AssignValues | public | Copy values from another collection. |
CreateParam | public | Create and add a new parameter to the collection. |
FindParam | public | Find a parameter with given name. |
GetParamList | public | Fetch a list of TParam instances. |
IsEqual | public | Is the list of parameters equal. |
GetEnumerator | public | Return an enumerator for the parameters. |
ParamByName | public | Return a parameter by name. |
ParseSQL | public | Parse SQL statement, replacing parameter names with SQL parameter placeholders. |
RemoveParam | public | Remove a parameter from the collection. |
CopyParamValuesFromDataset | public | Copy parameter values from the fields in a dataset. |
Inherited
From TCollection (28)
Add Assign BeginUpdate Changed Clear Count Delete Destroy EndUpdate Exchange FindItemID GetAttr GetAttrCount GetItem GetItemAttr GetNamePath Insert ItemClass Move Notify Owner PropName SetItem SetItemName SetPropName Sort Update UpdateCount
From TPersistent (4)
DefineProperties FPOAttachObserver FPODetachObserver FPONotifyObservers
From TObject (40)
AfterConstruction BeforeDestruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName SafeCallException StringMessageTable SystemHasExtendedRTTI ToString UnitName
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
