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

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for Oracle in Delphi and C++Builder
Post Reply
Rodolpho
Posts: 9
Joined: Wed 15 Jun 2011 13:25
Contact:

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

Post by Rodolpho » Wed 15 Jun 2011 13:49

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!

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

Post by AlexP » Thu 16 Jun 2011 08:46

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).

Rodolpho
Posts: 9
Joined: Wed 15 Jun 2011 13:25
Contact:

Post by Rodolpho » Mon 20 Jun 2011 20:10

Hi AlexP,

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

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

Post by AlexP » Tue 21 Jun 2011 08:36

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.

Rodolpho
Posts: 9
Joined: Wed 15 Jun 2011 13:25
Contact:

Post by Rodolpho » Wed 22 Jun 2011 13:53

Thanks a lot AlexP, but i solve it changing all my persistents NUMBER fields to use only TFMTBCDField...

Thank you very much!

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

Post by AlexP » Wed 22 Jun 2011 14:04

Hello,

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

Post Reply