Ingres Community Forums Login Register Ingres.com  

Ingres Community Forum


Go Back   Ingres Community Forums > Ingres Forums > Development Tools and Utilities
 

Reply
 
LinkBack Thread Tools Display Modes
Old 2009-06-24   #1 (permalink)
Junior Member
 
Join Date: May 2009
Posts: 2
Default diffence in float field value (via ingres tools v/s odbc )

i have install third party software benticSQALL client software and using ODBC oledb for ingres conntion.

every think i found ok except float field value.

a)
when i fire query through
ingres isql in unix platform
i found

unix ingres isql
----------------
select gross_wt from zzpallet_mst
52.940

b)
when i fire query in windows ingres isql

select gross_wt from zzpallet_mst
52.940

c)
when i fire query in bentic client software

benticSQALL client software (using ODBC oledb)
---------------------------------------------
select gross_wt from zzpallet_mst
52.939998626709

i found diffrenct value for this field value
why this difference happened ?
wheather ingress store valie 52.940 as in actual 52.939998626709 at table level.
so third part tools capture the same value and show to us?

please help how i will correct this.


i thunk that
some one using application via ODBC conntion
they will also get this wrong value.
how they correting this

regards
rajesh sangawat
rajesh_sangawat is offline   Reply With Quote
Old 2009-06-24   #2 (permalink)
Ingres Community
 
denjo02's Avatar
 
Join Date: Mar 2007
Posts: 131
Default

This is the nature of the float datatype. If load up two rows into a table, with floats containing values of 52.94 and 52.939998626709 then by default, isql will show both of them as 52.940

If however I start up ISQL using the -f8F20.15 flag to control the precision and scale of floats being displayed, these two rows are returned with these values:
52.940000000000000
52.939998626709000

These are both accurate.

I suspect that your ODBC application is not doing any rounding of the float. What value do you see if you use this -f flag with isql?
denjo02 is offline   Reply With Quote
Old 2009-06-25   #3 (permalink)
Ingres Community
 
kschendel's Avatar
 
Join Date: Mar 2007
Location: Pittsburgh, PA
Posts: 1,072
Send a message via Skype™ to kschendel
Default

To add to John's reply, the Ingres supplied tools (isql, qbf, etc) default to rounding floats to 3 decimal places. That's why you are seeing a rounded value from isql. The float value stored in the table is not rounded.
kschendel is offline   Reply With Quote
Old 2009-07-07   #4 (permalink)
Junior Member
 
Join Date: May 2009
Posts: 2
Default

Quote:
Originally Posted by kschendel View Post
To add to John's reply, the Ingres supplied tools (isql, qbf, etc) default to rounding floats to 3 decimal places. That's why you are seeing a rounded value from isql. The float value stored in the table is not rounded.
i agree with you that ingres rounding float value to 3 decimal value as define in ingres files/*.def files. these value can be view by ingres tools isql.

Can we suggest setting so that odbc tools can get default three digit fload value by default

thnaks for your help
rajesh_sangawat is offline   Reply With Quote
Old 2009-07-08   #5 (permalink)
Ingres Community
 
rhann's Avatar
 
Join Date: Mar 2007
Location: roy.hann@rationalcommerce.com
Posts: 304
Default

ODBC is an interface so it shouldn't ever mess with data in transit. The way the myriad ODBC-based tools display that data is up to their respective vendors/developers.

Your best option is to do as denjo02 suggested and use the -f4... and -f8... flags to select the display format of the Ingres tools.
__________________
Roy Hann

UK Ingres User Association Conference 2010 will be on Tuesday June 8, 2010
Go to http://www.iua.org.uk/join to get on the mailing list.
rhann is online now   Reply With Quote
Old 2009-08-11   #6 (permalink)
Junior Member
 
Join Date: Aug 2009
Posts: 2
Default

Quote:
Originally Posted by rhann View Post
ODBC is an interface so it shouldn't ever mess with data in transit. The way the myriad ODBC-based tools display that data is up to their respective vendors/developers.

Your best option is to do as denjo02 suggested and use the -f4... and -f8... flags to select the display format of the Ingres tools.
Interesting thought, i completely agree with your perspective

comparatif simulation taux pret auto - taux pret auto differe selon la prise en compte ... calculent automatiquement le taux pour un prĂȘt automobile donne.comparatif simulation taux pret auto
Maria2009 is offline   Reply With Quote

Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


© 2009 Ingres Corporation. All Rights Reserved