AGB  ·  Datenschutz  ·  Impressum  







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

Delphi TmysqlQuery

Ein Thema von question · begonnen am 3. Sep 2013 · letzter Beitrag vom 5. Sep 2013
Antwort Antwort
Seite 3 von 4     123 4      
question

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

AW: Delphi TmysqlQuery

  Alt 5. Sep 2013, 08:37
how can i convert dateformate from 05.09.2013 to 2013.09.05 17:00:00 using following query
Code:
query1.parambyname('newdate') := newdate //here is the 05.09.2013 17:00:00
but i want
Code:
query1.parambyname('newdate') := newdate /this formate i want 2013.09.05 17:00:00
  Mit Zitat antworten Zitat
Benutzerbild von DeddyH
DeddyH

Registriert seit: 17. Sep 2006
Ort: Barchfeld
27.542 Beiträge
 
Delphi 11 Alexandria
 
#22

AW: Delphi TmysqlQuery

  Alt 5. Sep 2013, 08:44
What type is newdate of?
Detlef
"Ich habe Angst vor dem Tag, an dem die Technologie unsere menschlichen Interaktionen übertrumpft. Die Welt wird eine Generation von Idioten bekommen." (Albert Einstein)
Dieser Tag ist längst gekommen
  Mit Zitat antworten Zitat
question

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

AW: Delphi TmysqlQuery

  Alt 5. Sep 2013, 08:54
sorry, i forgot to mention it is DateTime formate
Code:
query1.parambyname('newdate').AsDateTime := newdate /this formate i want 2013.09.05 17:00:00
  Mit Zitat antworten Zitat
mkinzler
(Moderator)

Registriert seit: 9. Dez 2005
Ort: Heilbronn
39.851 Beiträge
 
Delphi 11 Alexandria
 
#24

AW: Delphi TmysqlQuery

  Alt 5. Sep 2013, 09:01
A Windows/Delphi DateTime isn't formated ( it's a Double!). The machnism behind the Komponents should convert the Value into the coresponding fomat. ( Unfortunately mysql unlike other dbms stores string values in the format YYYY-MM-DD HH:MM:SS instead of the use of an independant format).

But as written before, your problem seems be different of this!
Markus Kinzler
  Mit Zitat antworten Zitat
question

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

AW: Delphi TmysqlQuery

  Alt 5. Sep 2013, 13:21
hi, finally i have found the problem, i DB there is one field as a Blob filed, i have read it as a string
forexample: 'lateId' is Blob field
Code:
Query1.ParamByName('lateID').(what to write here) := Query2.FieldByName('lateID').As(?)
  Mit Zitat antworten Zitat
mkinzler
(Moderator)

Registriert seit: 9. Dez 2005
Ort: Heilbronn
39.851 Beiträge
 
Delphi 11 Alexandria
 
#26

AW: Delphi TmysqlQuery

  Alt 5. Sep 2013, 13:46
Something like this
Delphi-Quellcode:
ms: TMemoryStream;
...

try
  ms := TMemoryStream.Create;
  (Query2.FieldByName('lateID') as TBlobField).SaveToStream( ms);
  (Query1.ParamByName('lateID') as TBlobField).LoadFromStream( ms);
finally
  ms.Free;
end;
Markus Kinzler
  Mit Zitat antworten Zitat
question

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

AW: Delphi TmysqlQuery

  Alt 5. Sep 2013, 13:52
can i also do the following
Code:
QueryA.ParamByName('lateId').AsString := QueryB.FieldByName('lateID').AsString
//Actually i need to do the work with fieldbyname and parambyname
how to that for blobfield with parambyname and fieldbyname
  Mit Zitat antworten Zitat
Benutzerbild von DeddyH
DeddyH

Registriert seit: 17. Sep 2006
Ort: Barchfeld
27.542 Beiträge
 
Delphi 11 Alexandria
 
#28

AW: Delphi TmysqlQuery

  Alt 5. Sep 2013, 14:26
As far as can I see Markus uses both FieldByName and ParamByName.
Detlef
"Ich habe Angst vor dem Tag, an dem die Technologie unsere menschlichen Interaktionen übertrumpft. Die Welt wird eine Generation von Idioten bekommen." (Albert Einstein)
Dieser Tag ist längst gekommen
  Mit Zitat antworten Zitat
question

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

AW: Delphi TmysqlQuery

  Alt 5. Sep 2013, 15:42
Hi,
i have still this problem concerning Blob field, i have treid many ways, actually before (when the SQL manager 2010 installed in German language) i have worked with blob field and it was working fine and then i have reinstalled SQL Manager 2010 in English language after that it blob data types are not working, do you think -it can be becaause of the language of SQL Manager?
  Mit Zitat antworten Zitat
question

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

AW: Delphi TmysqlQuery

  Alt 5. Sep 2013, 16:52
Hi,
Code:
//here 'name' is string field and i can write in the following way
 QueryA.ParamByName('Name').AsString := QueryB.FieldByName('Name').AsString;
is it also possible to do the same for blob field similar to string/integer field?
Code:
//here NewID is Blob field
QueryA.ParamByName('NewID ').??? :=QueryB.FieldByName('NewID').???; //here how to define the datatype for Blob , i have tried with As TblobField but it does not work
need your suggestion
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 3 von 4     123 4      


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 12:33 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz