Declaration¶
Source position: db.pas line 1389
type
TParam = class(TCollectionItem)
public
constructor Create(ACollection: TCollection); overload;
constructor Create(AParams: TParams; AParamType: TParamType); overload;
procedure Assign;
procedure AssignField;
procedure AssignToField;
procedure AssignFieldValue;
procedure AssignFromField;
procedure Clear;
procedure GetData;
function GetDataSize : Integer;
procedure LoadFromFile;
procedure LoadFromStream;
procedure SetBlobData;
procedure SetData;
property AsBCD: Currency; {rw}
property AsBlob: TBlobData; {rw}
property AsBoolean: Boolean; {rw}
property AsByte: LongInt; {rw}
property AsBytes: TBytes; {rw}
property AsCurrency: Currency; {rw}
property AsDate: TDateTime; {rw}
property AsDateTime: TDateTime; {rw}
property AsFloat: Double; {rw}
property AsInteger: LongInt; {rw}
property AsLargeInt: LargeInt; {rw}
property AsLongWord: LongWord; {rw}
property AsMemo: string; {rw}
property AsShortInt: LongInt; {rw}
property AsSingle: Single; {rw}
property AsSmallInt: LongInt; {rw}
property AsString: string; {rw}
property AsAnsiString: AnsiString; {rw}
property AsUTF8String: UTF8String; {rw}
property AsUnicodeString: UnicodeString; {rw}
property AsTime: TDateTime; {rw}
property AsWord: LongInt; {rw}
property AsFMTBCD: TBCD; {rw}
property Bound: Boolean; {rw}
property Dataset: TDataSet; {r}
property IsNull: Boolean; {r}
property NativeStr: string; {rw}
property Text: string; {rw}
property AsWideString: WideString; {rw}
published
property DataType: TFieldType; {rw}
property Name: string; {rw}
property NumericScale: Integer; {rwd}
property ParamType: TParamType; {rw}
property Precision: Integer; {rwd}
property Size: Integer; {rwd}
property Value: Variant; {rws}
end;
Inheritance¶
Description¶
TParam is one item in a TParams collection. It describes the name (TParam.Name), type (ParamType) and value (TParam.Value) of a parameter in a parameterized query or stored procedure. Under normal circumstances, it should never be necessary to create a TParam instance manually; the TDataset descendent that owns the parameters should have created all necessary TParam instances.
Properties¶
| Member | Visibility | Description |
|---|---|---|
| AsAnsiString | public | Parameter contents as an ANSI string. |
| AsBCD | public | Get or set parameter value as BCD value. |
| AsBlob | public | Return parameter value as a blob. |
| AsBoolean | public | Get/Set parameter value as a boolean value. |
| AsByte | public | Get/Set parameter value as a 8-bit unsigned integer value. |
| AsBytes | public | Get or set parameter value as TBytes. |
| AsCurrency | public | Get/Set parameter value as a currency value. |
| AsDate | public | Get/Set parameter value as a date (TDateTime) value. |
| AsDateTime | public | Get/Set parameter value as a date/time (TDateTime) value. |
| AsFloat | public | Get/Set parameter value as a floating-point value. |
| AsFMTBCD | public | Parameter value as a BCD value. |
| AsInteger | public | Get/Set parameter value as an integer (32-bit) value. |
| AsLargeInt | public | Get/Set parameter value as a 64-bit integer value. |
| AsLongWord | public | Get/Set parameter value as a 32-bit unsigned integer value. |
| AsMemo | public | Get/Set parameter value as a memo (string) value. |
| AsShortInt | public | |
| AsSingle | public | |
| AsSmallInt | public | Get/Set parameter value as a smallint value. |
| AsString | public | Get/Set parameter value as a string value. |
| AsTime | public | Get/Set parameter value as a time (TDateTime) value. |
| AsUnicodeString | public | Parameter contents as a Unicode string. |
| AsUTF8String | public | Parameter contents as an UTF8 string. |
| AsWideString | public | Get/Set the value as a widestring. |
| AsWord | public | Get/Set parameter value as a word value. |
| Bound | public | Is the parameter value bound (set to fixed value). |
| Dataset read only | public | Dataset to which this parameter belongs. |
| DataType | published | Data type of the parameter. |
| IsNull read only | public | Is the parameter empty. |
| Name | published | Name of the parameter. |
| NativeStr | public | No description available. |
| NumericScale | published | Numeric scale. |
| ParamType | published | Type of parameter. |
| Precision | published | Precision of the BCD value. |
| Size | published | Size of the parameter. |
| Text | public | Read or write the value of the parameter as a string. |
| Value | published | Value as a variant. |
Methods¶
| Member | Visibility | Description |
|---|---|---|
| Assign | public | Assign one parameter instance to another. |
| AssignField | public | Copy value from field instance. |
| AssignFieldValue | public | Assign field value to the parameter. |
| AssignFromField | public | Copy field type and value. |
| AssignToField | public | Assign parameter value to field. |
| Clear | public | Clear the parameter value. |
| Create | public | Create a new parameter value. |
| GetData | public | Get the parameter value from a memory buffer. |
| GetDataSize | public | Return the size of the data. |
| LoadFromFile | public | Load a parameter value from file. |
| LoadFromStream | public | Load a parameter value from stream. |
| SetBlobData | public | Set BLOB data. |
| SetData | public | Set the parameter value from a buffer. |