Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parameter value '33.42922222' is out of range

I have an attribute of a table named ad Latitude, i have set its data type as decimal(9,8) null but when i try to insert the value 33.42922222 it gives me the error

Parameter value '33.42922222' is out of range.

when i try to directly enter the value in the database table it gives the Arithmetic overflow error

i have tried to change the datatype to numeric(9,8) null but to no avail

please help me find out the problem ...

like image 771
John x Avatar asked Aug 22 '12 22:08

John x


2 Answers

For clarification DECIMAL(9,8) is 1 digit before the decimal point and 8 digits after the decimal point.

So DECIMAL(10,8) should work for 33.42922222.

decimal and numeric (Transact-SQL)

like image 100
Tim Schmelter Avatar answered Nov 03 '22 17:11

Tim Schmelter


Your precision is not enough. Set precision according to the maximum value which you except. For example, if you expect 999,999 as the maximum value and you need a scale of 8, set it as decimal(14,8).

like image 25
crnlx Avatar answered Nov 03 '22 17:11

crnlx