DbExpress does not read the millisecond portion of TimeStamp fields

Recently, some Delphi / InterBase applications display

"Record not found or modified by another user"

They use the standard TSQLQuery / TClientDataSet (or TSimpleDataSet) dbExpress components.

We found that in the database table the field was stored with milliseconds by a non-dbExpress application.

It seems that dbExpress did not read milliseconds from the database and used this truncated value in the "where" state of the SQL update table operator, so there was no suitable record for the update.

Update : we use the TSQLTimeStamp fields in the Delphi application. OnBeforePost handlers do not change the value of a field.

Update 2

As you can see in IBExternals.pas, PCTimeStructure does not have a millisecond part. Thus, "by design" is not supported by milliseconds for InterBase in Delphi (2009).

Does anyone know if ms support has been added in a later version of Delphi?

+1
source share
3 answers

I assume this is the isc_decode_timestamp Interbase / Firebird client API that does not support milliseconds. Here is a related issue with Firebird.

Update: see also.

+3
source

, dbexpress , , , . , , , SQL- , . TIMESTAMP DATETIME ( ). , TIMESTAMP .

0
var
  tmpDTS: string;
  tmpDT: TDateTiume;

DateTimeToString(tmpDTS,'yyyy"."mm"."dd" "hh"."nn"."ss" "zzz',tmpDT);

Firebird ( TSQLQuery), Flamerobin .

, TDateTime, . DBGrid , .

Delphi XE, Db Express, Firebird, Firebird 2.5.1.

-1
source

Source: https://habr.com/ru/post/1717666/


All Articles