Einzelnen Beitrag anzeigen

Benutzerbild von sx2008
sx2008

Registriert seit: 16. Feb 2008
Ort: Baden-Württemberg
2.332 Beiträge
 
Delphi 2007 Professional
 
#5

AW: Mysql Typs (Null) Typ (Integer)

  Alt 25. Aug 2013, 23:41
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
fork me on Github
  Mit Zitat antworten Zitat