BigDecimal and Oracle | Precision Issue when using Hibernate
843859Jun 30 2010 — edited Nov 20 2014I am facing an issue while persisting a BigDecimal value in orcale 9i db column of type Number(23,8) via hibernate.
I have created the following mapping and when trying to persist *434343434345.29* value being persisted in the db
*434343434345.28998400*
*<property name="myField" type="big_decimal">*
*<column name="myColumn" precision="23" scale="8"/>*
*</property>*
I also tried the following mappings and results were same
*<property name="myField" type="big_decimal">*
*<column name="myColumn" sql-type="NUMERIC(23,8)"/>*
*</property>*
One more observation was when I run the query
select from MyTable;*
it shows me value as *434343434345.28998400*
while when I run the following query
select to_char(myColumn), to_number(myColumn) from MyTable;
it shows me values as *434343434345.29*
Could someone kindly suggest the resolution. A quick help is required.
Thanks,
Dheeraj