TFDMemTable & TSQLTimeStampOffsetField

Hello Folks,

we are trying to use the TSQLTimeStampOffsetField defined in Data.DB.pas for a TFDMemTable. We created a static field list and tried to open the TFDMemtable. We run into an error:

Type mismatch for field ‘Start’, expecting: TimeStampOffset actual: Unknown.

The call stack …

Data.DB.DatabaseError(‘Type mismatch for field ‘‘Start’’, expecting: TimeStampOffset actual: Unknown’,$1767270)
Data.DB.DatabaseErrorFmt(‘Type mismatch for field ‘’%s’’, expecting: %s actual: %s’,(…),$1767270)
Data.DB.TDataSet.CheckFieldCompatibility($1758D20,$17FFE10)
Data.DB.DoBindFields($17FFF60)
Data.DB.TDataSet.BindFields(True)
FireDAC.Comp.DataSet.TFDDataSet.InternalOpen
Data.DB.TDataSet.DoInternalOpen
Data.DB.TDataSet.OpenCursor(???)
FireDAC.Comp.DataSet.TFDDataSet.OpenCursor(False)
Data.DB.TDataSet.SetActive(???)
FireDAC.Comp.DataSet.TFDDataSet.SetActive(???)
Data.DB.TDataSet.Open
FMain.TfrmMain.FormCreate($1780E30)
Vcl.Forms.TCustomForm.DoCreate
Vcl.Forms.TCustomForm.AfterConstruction
System._AfterConstruction($1780E30)
Vcl.Forms.TCustomForm.Create(???)
Vcl.Forms.TApplication.CreateForm(???,(no value))

… indicates that the TDataSet.CheckFieldCompatibility method points to a FieldDef for the column Start, for which the data type is unknown. I have tried to setup the FieldDefs first before opening the TFDMemTable but that did not help either.

Why can I define a field of type TSQLTimeStampOffsetField but when I open the dataset the data type is unknown? I am using Delphi 11 Alexandria Version 28.0.42600.6491.

I have asked the same question in the Delphi Praxis forum here.

Thanks for a short answer in advance.

Salut, 
Mathias

Looks like a bug to me. The code I traced shows TFDDataType used in various places which is defined as

  TFDDataType = (dtUnknown,                                 // unknown
    dtBoolean,                                              // Boolean
    dtSByte, dtInt16, dtInt32, dtInt64,                     // signed int
    dtByte, dtUInt16, dtUInt32, dtUInt64,                   // unsinged int
    dtSingle, dtDouble, dtExtended,                         // float point numbers
    dtCurrency, dtBCD, dtFmtBCD,                            // high-precision numbers
    dtDateTime, dtTime, dtDate, dtDateTimeStamp,            // date and time
    dtTimeIntervalFull, dtTimeIntervalYM, dtTimeIntervalDS, // time interval
    dtAnsiString, dtWideString, dtByteString,               // string
    dtBlob, dtMemo, dtWideMemo, dtXML,                      // value blobs
    dtHBlob, dtHMemo, dtWideHMemo,                          // handle blobs
    dtHBFile,                                               // external files
    dtRowSetRef, dtCursorRef, dtRowRef,
      dtArrayRef, dtParentRowRef,                           // adt -> ftDataSet, ftCursor, ftADT, ftArray
    dtGUID, dtObject);                                      // adt -> IFDDataStoredObject

And doesn’t seem to have a matching ftTimeStampOffset, resulting in the error with the dtUnknown.

A couple of the places that are likely to need to be updated are

TFDFormatOptions.FieldDef2ColumnDef
TFDDatSColumn.UpdateStorageSize

I think you will have to log a bug report to quality portal - I suspect this field type is not often used.

On checking the Quality portal I found Log in - Embarcadero Technologies