【问题标题】:Incorrect integer value when importing csv into a table via mysql workbench通过mysql工作台将csv导入表时整数值不正确
【发布时间】:2014-10-21 20:21:10
【问题描述】:

错误 1366:1366:不正确的整数值:第 1 行的列 'subcategory_id' 的 '' SQL 语句:

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', '')

【问题讨论】:

    标签: mysql sql csv mysql-workbench


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

      您需要将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', someintegervalue, 'W1800*D900*H724MM', '10', '')
                                                                 ^^^^^^^^^^^^^^^
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-07-30
        • 1970-01-01
        • 2012-07-10
        • 2015-02-24
        • 2013-04-10
        • 2015-06-22
        • 1970-01-01
        • 2013-08-30
        相关资源
        最近更新 更多