error while inserting value in int datatype column #9
-
Hi Tanmay, this is my table create table student(
); alter table student modify phone int(32); when I try to insert phone number in phone (10 digit) column getting below error Error Code: 1264. Out of range value for column 'phone' at row 1 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @akhil-lakka. The problem here is you are trying to save a 10 digit value in a column of an 1264 generally shows when you have the strict mode enabled. If you disable it, your input would get truncated and not thrown an error. |
Beta Was this translation helpful? Give feedback.
Hey @akhil-lakka.
The problem here is you are trying to save a 10 digit value in a column of an
int
datatype.int
has a maximum value of 2,14,74,83,647. It is likely your phone number was larger than this value.Instead of numeric, try using one of the string datatypes.
1264 generally shows when you have the strict mode enabled. If you disable it, your input would get truncated and not thrown an error.