Strange 1264 Out of Range Error

377 Views Asked by At

When running a set of insert statements in MySQL I keep getting Error Code: 1264. Out of range value for column 'x' at row 1. The column type is set to float(10, 10) and the values in the column range from 23.912 to 26.458 which are well within the bounds. I have absolutely no idea why I am receiving this error.

2

There are 2 best solutions below

1
Marc B On BEST ANSWER

float(10,10) means store 10 decimal places, with no space left for the integer component.

0.1234567890 would be valid, because that's 10 decimal places, but 1.234567890 isn't, because you didn't leave any space for the 1.

It's float(total digits, decimal places), and is a sum, not integer places, decimal places.

123.456789 = 9 digits total, 6 for decimals -> float(9, 6)
0
Rakesh Kumar On

For your values 23.912 to 26.458, float(10, 10) can't work. Description:-

In float first 10 says you can enter 10 digit in this field and second 10 says 10 digit after (.)

So in this fields you can insert:-

0.111111111
.
.
.
0.999999999

But you can't:-

1.111111111
.
.
.
.
.
111111111.1