纵有疾风起
人生不言弃

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

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

<span style="font-size:24px;">org.springframework.jdbc.BadSqlGrammarException: 
### Error querying database.  Cause: java.sql.SQLException: ORA-06550: 第 8 行, 第 4 列: 
PLS-00103: 出现符号 ";"在需要下列之一时:
 . ( ) , * @ % & = - + < / >
   at in is mod remainder not rem => <an exponent (**)>
   <> 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 => <an exponent (**)>
   <> 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 => <an exponent (**)>
   <> or != or ~= >= <= <> and or like like2 like4 likec between
   || indicator multiset member submultiset
符号 ")" 被替换为 ";" 后继续。</span>


原来是映射文件出错

       <select id="getProductsProc" parameterType="java.util.Map" statementType="CALLABLE">
    
        {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}
         )
         }  
    
     </select>  


call后面 右括号  忘了写


这是一个小细节


PS:

对于Oracle存储过程

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

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






原文链接:https://blog.csdn.net/w605283073/article/details/45768665

本站声明:网站内容来源于网络,如有侵权,请联系我们,我们将及时处理。

未经允许不得转载:起风网 » mybatis 操作存储过程 小细节错误
分享到: 生成海报

评论 抢沙发

评论前必须登录!

立即登录