Print Thread
BCD support in DOA
#8506 07/18/06 05:43 PM
Joined: Jul 2006
Posts: 5
Russia
E
Ender Offline OP
Member
OP Offline
Member
E
Joined: Jul 2006
Posts: 5
Russia
I'm writing program that require knowledge about actual datatypes of fields in select statement. For example i have table:

create table Test1(DocNumber NUMBER(12));

When i do select from this table

select DocNumber from Test1;

... i receive field of type TFloatField. Obviously it should be TBCD or TFMTBCD but it is not. How to enable BCD support in DOA?

Re: BCD support in DOA
#8507 07/18/06 08:25 PM
Joined: Aug 1999
Posts: 22,219
Member
Offline
Member
Joined: Aug 1999
Posts: 22,219
There is currently no BCD support in Direct Oracle Access. Number(12) fits nicely within the precision of a TFloatField though.


Marco Kalter
Allround Automations
Re: BCD support in DOA
#8508 01/16/07 11:39 AM
Joined: Jul 2006
Posts: 5
Russia
E
Ender Offline OP
Member
OP Offline
Member
E
Joined: Jul 2006
Posts: 5
Russia
Number(12) is just example. I have numbers like this Number(22) or Number(18,6). Support for TFMTBCD will be great feature.

Re: BCD support in DOA
#8509 01/24/07 07:27 PM
Joined: Jun 2003
Posts: 36
Bolzano, Italy
Member
Offline
Member
Joined: Jun 2003
Posts: 36
Bolzano, Italy
[quote]Originally posted by Ender:
Number(12) is just example. I have numbers like this Number(22) or Number(18,6). Support for TFMTBCD will be great feature. [/quote]Not just a feature but a must !!
Consider this example : I have a table with a field of type number(30).
I need to insert in this field a value like this one : 123456789123456789123456789.
Inserting this value using DOA or pl/sql developer this value will be transalted with Float precision and so in the database i have this value 123456789123457000000000000. Both values have the same floating point rapresentation (1,23456789123457E26) but are not equals. Inserting the same value using sql*plus the value is correctly inserted and displying both values using to_char reveal :

123456789123457000000000000 --> WITH DOA
123456789123456789123456789 --> WITH SQLPLUS

The same problem reading such values.
When i need to work with DOA i need to be sure the numeric fields are with a precision not exceding the Delphi Double one.

Regards

sergio sette

Re: BCD support in DOA
#8510 01/24/07 10:51 PM
Joined: Aug 1999
Posts: 22,219
Member
Offline
Member
Joined: Aug 1999
Posts: 22,219
In this case you can set TOracleSession.Preferences.FloatPrecision:

property FloatPrecision: Integer;

Maximum precision to be represented a floating point field (Double). Setting this property to 0 will cause all non-integer numbers to be represented as a floating point field, even though a Double has a maximum precision of 15 digits. Setting it to a non-zero value will cause higher-precision numbers to be represented as a string field. The number will be converted to a string on the server, using the current NLS_LANG settings. This preference affects fields in TOracleQuery and TOracleDataSet components.


Marco Kalter
Allround Automations
Re: BCD support in DOA
#8511 01/25/07 02:50 PM
Joined: Jun 2003
Posts: 36
Bolzano, Italy
Member
Offline
Member
Joined: Jun 2003
Posts: 36
Bolzano, Italy
[quote]Originally posted by Marco Kalter:
In this case you can set TOracleSession.Preferences.FloatPrecision:
[/quote]Hi Marco,

i'm aware of this options but that means i need to work with string instead of BCD.
I know the BCD support is in delphi not so complete (i.e.tandard operators like +, - ...cannot be used) but we have TFMDBcdField and IMHO DOA should support it.

Best regards

s7


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.086s Queries: 13 (0.046s) Memory: 2.5197 MB (Peak: 3.0405 MB) Data Comp: Off Server Time: 2024-05-16 04:08:28 UTC
Valid HTML 5 and Valid CSS