前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >mybatis 操作存储过程 小细节错误

mybatis 操作存储过程 小细节错误

作者头像
明明如月学长
发布于 2021-08-27 02:51:30
发布于 2021-08-27 02:51:30
75000
代码可运行
举报
运行总次数:0
代码可运行

项目开发的时候遇到一个错误:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
org.springframework.jdbc.BadSqlGrammarException: 
### Error querying database.  Cause: java.sql.SQLException: ORA-06550:8,4 : 
PLS-00103: 出现符号 ";"在需要下列之一时:
 . ( ) , * @ % & = - + < / >
   at in is mod remainder not rem => 
   <> or != or ~= >= <= <> and or like like2 like4 likec between
   || indicator multiset member submultiset
符号 ")" 被替换为 ";" 后继续。

### The error may exist in file [D:\Program Files\Workspaces\MyEclipse for Spring 2014\salesmanb2b\WebRoot\WEB-INF\classes\sqlmap\ProductMapper.xml]
### The error may involve com.salesmanb2b.mapper.ProductMapper.getProductsProc-Inline
### The error occurred while setting parameters
### SQL: {call GET_PRODUCTS   (    ?,    ?,    ?,    ?,    ?    }
### Cause: java.sql.SQLException: ORA-06550:8,4 : 
PLS-00103: 出现符号 ";"在需要下列之一时:
 . ( ) , * @ % & = - + < / >
   at in is mod remainder not rem => 
   <> or != or ~= >= <= <> and or like like2 like4 likec between
   || indicator multiset member submultiset
符号 ")" 被替换为 ";" 后继续。

; bad SQL grammar []; nested exception is java.sql.SQLException: ORA-06550:8,4 : 
PLS-00103: 出现符号 ";"在需要下列之一时:
 . ( ) , * @ % & = - + < / >
   at in is mod remainder not rem => 
   <> or != or ~= >= <= <> and or like like2 like4 likec between
   || indicator multiset member submultiset
符号 ")" 被替换为 ";" 后继续。

原来是映射文件出错

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
        {call GET_PRODUCTS
        (
         #{proid,jdbcType=INTEGER, mode=IN},
         #{product1,javaType=ResultSet,jdbcType=CURSOR,resultMap=product,mode=OUT},
         #{product2,javaType=ResultSet,jdbcType=CURSOR,resultMap=product,mode=OUT},
         #{product3,javaType=ResultSet,jdbcType=CURSOR,resultMap=product,mode=OUT},
         #{product4,javaType=ResultSet,jdbcType=CURSOR,resultMap=product,mode=OUT}
         )
         }  

call后面 右括号  忘了写

这是一个小细节

PS:

对于Oracle存储过程

建议 用navicat 编写好之后运行 成功再去编写代码

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2015/05/16 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档