项目开发的时候遇到一个错误:
<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>
原来是映射文件出错
<span style="font-size:24px;"> <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> </span>
call后面 右括号 忘了写
这是一个小细节
PS:
对于Oracle存储过程
建议 用navicat 编写好之后运行 成功再去编写代码
时间: 2024-10-06 22:41:05