简体   繁体   English

通过mysql工作台将csv导入表时不正确的整数值

[英]Incorrect integer value when importing csv into a table via mysql workbench

ERROR 1366: 1366: Incorrect integer value: '' for column 'subcategory_id' at row 1 SQL Statement: 错误1366:1366:第1行SQL语句的'subcategory_id'列的整数值不正确'':

INSERT INTO `db`.`shelf` (`shelf_id`, `model_code_name`, `customer_friendly_name`, `sku_code`, `description`, `unitmeasure_id`, `category_id`, `subcategory_id`, `colour`, `size`, `vendor_id`) 
VALUES ('919025', '', 'MS919025', 'NULL', '1', '3', '31', '', 'W1800*D900*H724MM', '10', '')

You need to make the value of subcategory_id as integer value rather than '' 您需要将subcategory_id的值设为整数值,而不是''

So the query should be like 所以查询应该像

INSERT INTO db.shelf (shelf_id, model_code_name, customer_friendly_name, sku_code, description, unitmeasure_id, category_id, subcategory_id, colour, size, vendor_id) 
VALUES ('919025', '', 'MS919025', 'NULL', '1', '3', '31', someintegervalue, 'W1800*D900*H724MM', '10', '')
                                                           ^^^^^^^^^^^^^^^

''不是整数(介于31和W1800之间)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM