TFloatField x TIntegerField, a solution, please

Hi,

Simpler than this, impossible: What do I need to set (and where) to fields declared as Integer (Number(15), I think) in Oracle be created as TIntegerField (and not TFloatField)?

I'd like that, when clicking "Add all fields" within the TFields Editor, those fields appear as TIntegerField.

Thanks in advance.

Clayton.
 
It is possible to achieve this by setting the Preferences.IntegerPrecision property on the Session component. The problem is that the TIntegerField is unable to handle integers that big! So the question is: Is there a way to make DOA use the TLargeIntField instead?

We haven't tried to use TLargeIntField, but I guess you would have to try that if you want to avoid using TFloatField for these columns.

What we have done, is to use our own TDwOracleDataset component, which inherits from TOracleDataset. In this component, we override the protected method GetFieldClass (function GetFieldClass(FieldType: TFieldType): TFieldClass ;).

This way you can determine for yourself which field class is used when you add fields to a dataset at design time. (In our case we have also designed our own field classes, with added capabilities to the standard Delphi fields.)

Example from the code:

function TdwOracleDataSet.GetFieldClass(FieldType: TFieldType): TFieldClass;
var inherited_Class: TFieldClass;
begin
inherited_Class:= Inherited GetFieldClass (FieldType);

If inherited_Class = TStringField then
result := TdwStringField
else If inherited_Class = TSmallintField then
result := TdwSmallintField
else If inherited_Class = TIntegerField then
result := TdwIntegerField
(...)

[This message has been edited by helene (edited 22 May 2002).]
 
Back
Top