In my java web application, I am inserting some records into MySql db. I have a column name 'value' whose Field type is float. When I insert the following value 76.8653846153846 into db, it gives exception of Data truncated for column 'value' at row 1. I changed field type to Double but same message. Any idea?
Field description:
As per the documentation you must define your number type with the level of precision you require.
for your number 76.8653846153846 use
FLOAT(10,13)
The 13
being large enough to handle your .8653846153846
[Edit]
to alter your existing table execute this command substituting your table and column name for mytable and mycolumn respectively
ALTER TABLE mytable MODIFY mycolumn FLOAT(10,13)
This comes from the database engine where the declared field's description in the table is not big enough to insert the complete data
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With