Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Delphi and Oracle: data type problem

Re: Delphi and Oracle: data type problem

From: Sheldon Wang <sheldon.wang_at_cdott.com>
Date: Fri, 25 Sep 1998 15:25:10 -0600
Message-ID: <6uh1p7$kv0$1@nntp2.uunet.ca>


Thanks for your response.

I did a test and found that Delphi BDE automatically determines how to convert data types.

For Oracle table with field NUMBER(11) and greater (say, Number(12)....), Delphi translates the NUMBER(10)... to
TFloatField. FOr Oracle Field NUMBER(10) and less ..., Delphi translates the NUMBER(10) to TIntegerField.

It seems that it is arbitrary whether BDE translates a NUMBER into TFloatField or TIntegerField.

Is there a place in Delphi where I can specify how to translate the NUMBER() from Oracle tables?

Thanks again.

tomscott_at_nospam.abac.com wrote in message <360bf76b.610139641_at_news1.abac.com>...
>>I use Delphi as a front-end tool to write application that talks to an
>>Oracle database. I have a problem with the Data Type conversion from
Oracle
>>to Delphi. In Oracle tables, I have a field with type NUMBER(10),
however
>>when I use Delphi's Field Editor to add the fields in Oracle tables to
>>Delphi application, the NUMBER(10) field in Oracle is converted into
>>TFloatField in Delphi. How does Delphi pick the field type from Oracle
>>tables? I have noticed that sometimes Delphi converts NUMBER(10) to
>>TFloatField, sometimes converts to TIntegerField, why?
>
>The BDE does not understand that a Number field without scale is
>really an integer. Neither does it understand cursor variables very
>well. Since I do a lot of work with Oracle, I decided to write my own
>component that was both package and datatype aware. This component
>looks at the system tables to see if a type is a NUMBER, and if it has
>no scale, sets the Delphi datatype to integer. You can do the same
>thing dynamically in code.
Received on Fri Sep 25 1998 - 16:25:10 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US