数据截断:第1行的列'sql_stmt'的数据太长

时间:2017-09-11 04:01:09

标签: java mysql mybatis

这是我的xml代码

<insert id="insertAnnualKiln" parameterType="list">
        insert into prm_annual_kiln (id,parent_id,runtime_kiln,runtimerate_kiln,shutdowntime_kiln,
        shutdowndesc_kiln,heat_clinker,elect_clinker,equip_code,prod_clinker_type) VALUES
        <foreach collection="list" item="item" separator=",">
            (#{item.id},#{item.parentId},#{item.runtimeKiln},#{item.runtimerateKiln},
            #{item.shutdowntimeKiln},#{item.shutdowndescKiln},#{item.heatClinker},#{item.electClinker}
            ,#{item.equipCode},#{item.prodClinkerType})
        </foreach>
    </insert>

列表中有36个元素,当我将列表剪切为10个元素时,它成功了,这是错误。

### SQL: insert into prm_annual_kiln (id,parent_id,runtime_kiln,runtimerate_kiln,shutdowntime_kiln,   shutdowndesc_kiln,heat_clinker,elect_clinker,equip_code,prod_clinker_type) VALUES         (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)    ,     (?,?,?,?,    ?,?,?,?    ,?,?)
### Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'sql_stmt' at row 1
; SQL []; Data truncation: Data too long for column 'sql_stmt' at row 1; nested exception is com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'sql_stmt' at row 1

1 个答案:

答案 0 :(得分:0)

更改表格中的列sql_stmt定义以设置更长的长度。如:

ALTER TABLE <table_name> MODIFY sql_stmt VARCHAR(<a longer length>);
相关问题