MQSQL插入数据报错

_叶轻舟 2015-07-17 04:02:51
### The error may involve repository.mybatis.itf.order.source.OrderSourceImportDataMapper.insert-Inline
### The error occurred while setting parameters
### SQL: insert into oms_order_source_import_data (id,flag_id, shop_id, express_id, warehouse_id, enterprise_id, tid, buyer_nick, title, num_iid, goods_barcode, plat_status, created, pay_time, num, price, post_fee, total_fee, buyer_message, seller_memo, receiver_name, receiver_phone, receiver_mobile, receiver_state, receiver_city, receiver_district, receiver_address) values (?,? ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1, 4,
2, 1, 505300001,
'友商通', '举例产品名称luna 上衣' at line 10
; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1, 4,
2, 1, 505300001,
'友商通', '举例产品名称luna 上衣' at line 10
[DEBUG] org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver.doResolveHandlerMethodException(360) | Invoking @ExceptionHandler method: public org.springframework.web.servlet.ModelAndView controller.BaseController.doResolveException(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,java.lang.Object,java.lang.Exception)
七月 17, 2015 3:50:07 下午 com.yonyou.util.exception.ShopExceptionHandler doRuntimeException
SEVERE: file:[SQLErrorCodeSQLExceptionTranslator.java],class:[org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator],method:[doTranslate],line:[231],type:[RuntimeException],message:


org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl.debug(46) | ==> Parameters: a5a65d137ac54932bf9e5ac5c6534716(String), 3f69a80d580c4e2ab720cfa499a29cf6(String), 1(Integer), 4(Integer), 2(Integer), 1(Integer), 505300001(BigDecimal), 友商通(String), 举例产品名称luna 上衣(String), 1(BigDecimal), 69012345678(String), 已付款(String), 42129.4237268519(String), 42129.4244212963(String), 12(BigDecimal), 12(String), 10(String), 154(String), 买家留言(String), 卖家备注(String), 张三(String), 收货人电话(String), 收货人手机(String), 北京(String), 北京市(String), 朝阳区(String), 北京市朝阳区张三路112号(String)
...全文
357 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
_叶轻舟 2015-07-17
  • 打赏
  • 举报
回复
非常感谢……
306210489 2015-07-17
  • 打赏
  • 举报
回复
中间是不是少了个逗号?#{flagId,jdbcType=VARCHAR} #{shopId,jdbcType=INTEGER}
_叶轻舟 2015-07-17
  • 打赏
  • 举报
回复
SQL是mybqtis里写的 <insert id="insert" parameterType="repository.entity.order.source.OrderSourceImportData" > insert into oms_order_source_import_data (id,flag_id, shop_id, express_id, warehouse_id, enterprise_id, tid, buyer_nick, title, num_iid, goods_barcode, plat_status, created, pay_time, num, price, post_fee, total_fee, buyer_message, seller_memo, receiver_name, receiver_phone, receiver_mobile, receiver_state, receiver_city, receiver_district, receiver_address) values (#{id,jdbcType=VARCHAR},#{flagId,jdbcType=VARCHAR} #{shopId,jdbcType=INTEGER}, #{expressId,jdbcType=INTEGER}, #{warehouseId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{tid,jdbcType=DECIMAL}, #{buyerNick,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{numIid,jdbcType=DECIMAL}, #{goodsBarcode,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{created,jdbcType=CHAR}, #{payTime,jdbcType=CHAR}, #{num,jdbcType=DECIMAL}, #{price,jdbcType=VARCHAR}, #{postFee,jdbcType=VARCHAR}, #{totalFee,jdbcType=VARCHAR}, #{buyerMessage,jdbcType=VARCHAR}, #{sellerMemo,jdbcType=VARCHAR}, #{receiverName,jdbcType=VARCHAR}, #{receiverPhone,jdbcType=VARCHAR}, #{receiverMobile,jdbcType=VARCHAR}, #{receiverState,jdbcType=VARCHAR}, #{receiverCity,jdbcType=VARCHAR}, #{receiverDistrict,jdbcType=VARCHAR}, #{receiverAddress,jdbcType=VARCHAR}) </insert>
306210489 2015-07-17
  • 打赏
  • 举报
回复
你这个SQL是自己拼的吧,你把程序执行的SQL打印出来看看
_叶轻舟 2015-07-17
  • 打赏
  • 举报
回复
我把insert摘出来 又把数据放进去是可以插入数据的。

下面这个事数据库执行的语句
INSERT INTO oms_order_source_import_data (
id,
flag_id,
shop_id,
express_id,
warehouse_id,
enterprise_id,
tid,
buyer_nick,
title,
num_iid,
goods_barcode,
plat_status,
created,
pay_time,
num,
price,
post_fee,
total_fee,
buyer_message,
seller_memo,
receiver_name,
receiver_phone,
receiver_mobile,
receiver_state,
receiver_city,
receiver_district,
receiver_address)
VALUES ('2f58fa5dc4b74631ac62485d9719a128', 'eaaaf4392c664b44bf7f7aabd5851ed7', 1, 4, 2, 1, 505300001, '友商通',
'举例产品名称luna 上衣', 1, '69012345678', '已付款', '42129.4237268519', '42129.4244212963', 12, '12', '10', '154',
'买家留言', '卖家备注', '张三', '收货人电话', '收货人手机', '北京', '北京市', '朝阳区', '北京市朝阳区张三路112号')
306210489 2015-07-17
  • 打赏
  • 举报
回复
sql语法错误,你把insert语句摘出来看看是不是错了

56,677

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧