AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Mysql Typs (Null) Typ (Integer)

Ein Thema von question · begonnen am 25. Aug 2013 · letzter Beitrag vom 25. Aug 2013
Antwort Antwort
question

Registriert seit: 17. Apr 2013
97 Beiträge
 
#1

AW: Mysql Typs (Null) Typ (Integer)

  Alt 25. Aug 2013, 21:17
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
value of both query can be different, i mean Null and 0?
  Mit Zitat antworten Zitat
Benutzerbild von Valle
Valle

Registriert seit: 26. Dez 2005
Ort: Karlsruhe
1.223 Beiträge
 
#2

AW: Mysql Typs (Null) Typ (Integer)

  Alt 25. Aug 2013, 22:22
You can copy data without using Delphi:

Code:
-- untested, might need some more parenthesis
INSERT INTO `B` (foo, bar)
SELECT foo, bar FROM `A` WHERE id = 42;
That requires less network traffic and should be much faster.

Maybe that would be a better alternative for you.
Valentin Voigt
BOFH excuse #423: „It's not RFC-822 compliant.“
Mein total langweiliger Blog
  Mit Zitat antworten Zitat
Benutzerbild von sx2008
sx2008

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

AW: Mysql Typs (Null) Typ (Integer)

  Alt 25. Aug 2013, 22: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
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:45 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz