Delphi-PRAXiS
Seite 3 von 4     123 4      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   Delphi TmysqlQuery (https://www.delphipraxis.net/176416-delphi-tmysqlquery.html)

question 5. Sep 2013 08:37

AW: Delphi TmysqlQuery
 
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

DeddyH 5. Sep 2013 08:44

AW: Delphi TmysqlQuery
 
What type is newdate of?

question 5. Sep 2013 08:54

AW: Delphi TmysqlQuery
 
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

mkinzler 5. Sep 2013 09:01

AW: Delphi TmysqlQuery
 
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!

question 5. Sep 2013 13:21

AW: Delphi TmysqlQuery
 
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(?)

mkinzler 5. Sep 2013 13:46

AW: Delphi TmysqlQuery
 
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;

question 5. Sep 2013 13:52

AW: Delphi TmysqlQuery
 
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

DeddyH 5. Sep 2013 14:26

AW: Delphi TmysqlQuery
 
As far as can I see Markus uses both FieldByName and ParamByName.

question 5. Sep 2013 15:42

AW: Delphi TmysqlQuery
 
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?

question 5. Sep 2013 16:52

AW: Delphi TmysqlQuery
 
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


Alle Zeitangaben in WEZ +1. Es ist jetzt 17:59 Uhr.
Seite 3 von 4     123 4      

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