NewField... TOraTimeStampField?

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
m.ghilardi
Posts: 41
Joined: Thu 13 Mar 2014 11:14

NewField... TOraTimeStampField?

Post by m.ghilardi » Tue 15 Sep 2015 14:05

I have a table declared like this

Code: Select all

create table table_ts
(
    --many fields....
    a_timestamp timestamp(0) with time zone
    --....
);
Put a TOraQuery on a form

Code: Select all

select * from table_ts
From RAD Studio design, go to Structure>OraQuery1->Fields->New Field...
In the following form, I cannot select OraTimeStamp type. SQLTimestamp is wrong, since at runtime I get "field a_timestamp is of wrong type"

So I open the dfm and change the type from TSQLTimestampField to TOraTimestampField (the same on the .pas or .h) but this is not enough
"field a_timestamp is of wrong type. Got TOraTimestampField, expected TOraTimestampField"

weird.

Go back to dfm. Force DataType

Code: Select all

    object Qrya_timestamp: TOraTimeStampField
      FieldName = 'a_timestamp'
      DataType = 105
    end
I found that this workaround is made automatically if I select Add Fields... in the designer. Sadly, this requires that I have a database connection active while developing the application, and this is not always true.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: NewField... TOraTimeStampField?

Post by AlexP » Wed 16 Sep 2015 09:26

Hello,

Unfortunately, we can't change this behavior. Field types available for selection are added in the Register method of the DBReg.pas module.

m.ghilardi
Posts: 41
Joined: Thu 13 Mar 2014 11:14

Re: NewField... TOraTimeStampField?

Post by m.ghilardi » Wed 16 Sep 2015 13:10

AlexP wrote:Hello,

Unfortunately, we can't change this behavior. Field types available for selection are added in the Register method of the DBReg.pas module.
Hello AlexP,

I understand that you cannot modify DBReg.pas. Can you at least remove the need to add "DataType = 105" in the dfm?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: NewField... TOraTimeStampField?

Post by AlexP » Wed 16 Sep 2015 15:01

DataType should be added to DFM, since the TOraTimeStampField field may contain several different types: ftOraTimeStamp, ftOraTimeStampTZ and ftOraTimeStampLTZ.

m.ghilardi
Posts: 41
Joined: Thu 13 Mar 2014 11:14

Re: NewField... TOraTimeStampField?

Post by m.ghilardi » Fri 18 Sep 2015 07:43

Ok now I understand. Thanks for the explanation, AlexP.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: NewField... TOraTimeStampField?

Post by AlexP » Mon 21 Sep 2015 04:33

You are welcome. Feel free to contact us if you have any further questions.

Post Reply