Code:
QueryA.ParamByName('ID').AsInteger := QueryBID.AsInteger //this using the field of
VCL Component)
QueryYA.ParamByName('ID').AsInteger := ueryB.FieldByName(('ID').AsInteger;// this using sqil
query fieldbyname
If you want to transfer a Value that could be both a integer or NULL you have to use the data type "
Variant".
A
Variant
can contain different data type like integer, floats, booleans, strings.
And a Variant can also be
Null
!
This means that
Variant
is a nullable data type.
To get or set the value of a field you can use the
property Value
.
The Properties AsString, AsInteger, AsBoolean,... are specialised properties.
Delphi-Quellcode:
// your code example using property Value instead of property AsInteger
QueryA.ParamByName('
ID').Value := QueryBID.Value;
//this using the field of VCL Component)
QueryYA.ParamByName('
ID').Value := ueryB.FieldByName(('
ID').Value;
// this using sqil query fieldbyname