Page 1 of 1

How i do aways make a Oracle NUMBER(9) Datatype to Integer?

Posted: Wed 15 Jun 2011 13:49
by Rodolpho
Hi guys,

I have a virtual field that cames from my SQL and when i create a persistent field in Delphi, it maps to a FloatField. Ok. When a create persistent field that original field in Oracle is datatype NUMBER(9), the Delphi maps it with a IntegerField. I need to do something like this:

Code: Select all

select 0 as myfieldINT from mytableA
union
select field as myfieldINT from mytableB
When i do it, i have a error message: Type mismatch for field "myfield": expecting: BCD' actual: FMTBcdField, Because the Oracle sends to Delphi that field is a Float Datatype.

So, i want make every Oracle datatype NUMBER(9) make on Delphi FloatNumber.

I already try to do all Oracle datatype NUMBER(9) make on FloatField in Delphi:
  • Turn off EnabledBCD Params
    Set FloatPrecision=9 Params
But until now does not work.

Somebody have any idea how make it?

Thanks for All!

Posted: Thu 16 Jun 2011 08:46
by AlexP
Hello,

To solve this problem, you should set the EnableBCD property of the TSQLConnection.AfterConnect event in the following way:
procedure TForm1.SQLConnection1AfterConnect(Sender: TObject);
const
coEnableBCD = TSQLConnectionOption(102);
begin
SQLConnection1.SQLConnection.SetOption(coEnableBCD, Integer(False));
end;
and you should not add fields in the design-time.
This is connected with the specificity of dbExpress 3. In version 4 these settings can be added in design-time (dbExpress version 4 is supported in Delphi starting from the 2007 version).

Posted: Mon 20 Jun 2011 20:10
by Rodolpho
Hi AlexP,

Still does not work. What i really do to DBX never maps TIntegerField?

Posted: Tue 21 Jun 2011 08:36
by AlexP
Hello,


Please specify the following information:
the version of the Oracle server and client;
the version of your dbExpress driver;
the version of your IDE.
Also please send us an application demonstrating the problem including scripts for creating and filling tables to alexp*devart*com.

Posted: Wed 22 Jun 2011 13:53
by Rodolpho
Thanks a lot AlexP, but i solve it changing all my persistents NUMBER fields to use only TFMTBCDField...

Thank you very much!

Posted: Wed 22 Jun 2011 14:04
by AlexP
Hello,

Glad to see that the problem was solved. If any other questions come up, please contact us.