得到sql错误1265并不确定为什么

时间:2016-10-26 18:21:32

标签: java mysql sql phpmyadmin

尝试从java应用程序插入时出现1265错误但是当尝试从phpmyadmin插入时它工作正常吗?任何想法为什么?
或者我怎么能分辨哪个字段给出错误
我正在运行一个将数据输入到mysql数据库的java应用程序     insert是关于运行错误的人的查询     我查看了这个错误1265,当它试图输入biger值然后分配给表中的文件时,它似乎很开心 但是当我从phpmyadmin运行这个插入字符串时,它接受它

enter image description here

  insert into delivery (`truckid`, `Factory`, `rangedelivery`, `deliverydate`, `deliveryid`, 
        `costdocument`, `amount`, `completion`, `sumamount`, `pricelist`, `delivery`, 
        `standbytime`, `waiting`, `night`, `descriptionextra`, `extension`, `mixing`, `value`) 
        VALUES ('460', 'N041', '0037', '2016-05-24', '6400439688', '5674250',
        '14.00', '0.00', '14.00', '81.57', '1,141.98', '0.00', '0.00', '0.00', '', '0.00', '114.20', '1256.18')
        SQLException: Data truncated for column 'delivery' at row 1
        SQLState: 01000
        VendorError: 1265

1 个答案:

答案 0 :(得分:0)

请尝试删除逗号' 1,141.98'

 insert into delivery (`truckid`, `Factory`, `rangedelivery`, `deliverydate`, `deliveryid`, 
    `costdocument`, `amount`, `completion`, `sumamount`, `pricelist`, `delivery`, 
    `standbytime`, `waiting`, `night`, `descriptionextra`, `extension`, `mixing`, `value`) 
    VALUES ('460', 'N041', '0037', '2016-05-24', '6400439688', '5674250',
    '14.00', '0.00', '14.00', '81.57', '1141.98', '0.00', '0.00', '0.00', '', '0.00', '114.20', '1256.18')