It has nothing to do with "single quotes", columns like int
do not need "quotes" in past values
That mistake:
1264 - Out of range value for column
Indicates that the entered value has exceeded the set limit, it is likely that you are not inserting 2012
, but a totally different value (or the problem is in the data input) or maybe you used something like DECIMAL(1,1)
.
You can change the size with ALTER TABLE
(if the guy isn’t int
):
ALTER TABLE veiculos MODIFY COLUMN ano INT(4);
You can also choose the type DATE
or YEAR(4)
, I don’t know what the advantages will have with the type of date columns, but maybe it is the use of functions for calculations.
Now if the problem is really in the year, the problem is at the origin of the data.
Confirm the type of column
ano
, because it must not be likeint
, put the DDL of your Tableaveiculo
.– Homer Simpson