From a33023e3845c816214c75f5f4a607c1809bb6327 Mon Sep 17 00:00:00 2001 From: joost Date: Thu, 29 May 2008 18:52:18 +0000 Subject: [PATCH] * Patch from Joao Morais to fix the storage of floating point, time and timestamp fields on a PgSQL database git-svn-id: trunk@11128 - --- packages/fcl-db/src/sqldb/postgres/pqconnection.pp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/fcl-db/src/sqldb/postgres/pqconnection.pp b/packages/fcl-db/src/sqldb/postgres/pqconnection.pp index db13d60685..574df5ffe1 100644 --- a/packages/fcl-db/src/sqldb/postgres/pqconnection.pp +++ b/packages/fcl-db/src/sqldb/postgres/pqconnection.pp @@ -568,10 +568,16 @@ begin for i := 0 to AParams.count -1 do if not AParams[i].IsNull then begin case AParams[i].DataType of - ftdatetime : s := formatdatetime('YYYY-MM-DD',AParams[i].AsDateTime); - ftdate : s := formatdatetime('YYYY-MM-DD',AParams[i].AsDateTime); - else - s := AParams[i].asstring; + ftDateTime: + s := FormatDateTime('yyyy-mm-dd hh:nn:ss', AParams[i].AsDateTime); + ftDate: + s := FormatDateTime('yyyy-mm-dd', AParams[i].AsDateTime); + ftTime: + s := FormatDateTime('hh:nn:ss', AParams[i].AsDateTime); + ftFloat, ftCurrency: + Str(AParams[i].AsFloat, s); + else + s := AParams[i].AsString; end; {case} GetMem(ar[i],length(s)+1); StrMove(PChar(ar[i]),Pchar(s),Length(S)+1);