Page 1 of 1

NewField... TOraTimeStampField?

Posted: Tue 15 Sep 2015 14:05
by m.ghilardi
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.

Re: NewField... TOraTimeStampField?

Posted: Wed 16 Sep 2015 09:26
by AlexP
Hello,

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

Re: NewField... TOraTimeStampField?

Posted: Wed 16 Sep 2015 13:10
by m.ghilardi
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?

Re: NewField... TOraTimeStampField?

Posted: Wed 16 Sep 2015 15:01
by AlexP
DataType should be added to DFM, since the TOraTimeStampField field may contain several different types: ftOraTimeStamp, ftOraTimeStampTZ and ftOraTimeStampLTZ.

Re: NewField... TOraTimeStampField?

Posted: Fri 18 Sep 2015 07:43
by m.ghilardi
Ok now I understand. Thanks for the explanation, AlexP.

Re: NewField... TOraTimeStampField?

Posted: Mon 21 Sep 2015 04:33
by AlexP
You are welcome. Feel free to contact us if you have any further questions.