You have strict sql mode enabled, and you try to pass an empty string
('') as value for decimal fields in the insert. Empty string is an
invalid value for a numeric field and in strict sql mode
mysql generates an error if you try to insert an invalid data into a
column, rather than providing a warning and use the default value (0 for
numeric columns) of the particular column's data type:
Strict mode controls how MySQL handles invalid or missing values in data-change statements such as INSERT or UPDATE. A value can be invalid for several reasons. For example, it might have the wrong data type for the column, or it might be out of range. A value is missing when a new row to be inserted does not contain a value for a non-NULL column that has no explicit DEFAULT clause in its definition. (For a NULL column, NULL is inserted if the value is missing.) Strict mode also affects DDL statements such as CREATE TABLE.Remove the strict sql mode for the session before starting the import:
|
Reference:
https://stackoverflow.com/questions/35037288/incorrect-decimal-integer-value-mysql
No comments:
Post a Comment