2

I'm getting following error while calling the oracle function...

    org.springframework.jdbc.UncategorizedSQLException: 
### Error querying database.  Cause: java.sql.SQLException: Non supported SQL92 token at position: 1: 
### The error may exist in file [C:\Users\pkr\rpt\bin\dbmappers\MyMapper.xml]
### The error may involve com.pkr.tpy.rpt.dao.MyDao.resetRecs-Inline
### The error occurred while setting parameters
### SQL: {    ? = call actions.reset_recs(?,                  ?,                  ?,                  ?)    }
### Cause: java.sql.SQLException: Non supported SQL92 token at position: 1: 
; uncategorized SQLException for SQL []; SQL state [99999]; error code [17034]; Non supported SQL92 token at position: 1: ; nested exception is java.sql.SQLException: Non supported SQL92 token at position: 1: 
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:84)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
    at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:75)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:447)
    at com.sun.proxy.$Proxy37.selectOne(Unknown Source)

Here is my mapper.xml

<select id="resetRecs" resultType="String"   statementType="CALLABLE">  
    {
    #{retVal,mode=OUT,jdbcType=VARCHAR} = call actions.reset_recs(#{xCode, jdbcType=DECIMAL,mode=IN},
                                 #{yCode,jdbcType=DECIMAL,mode=IN},
                                 #{xyzNum,jdbcType=DECIMAL,mode=IN},
                                 #{src,jdbcType=VARCHAR,mode=IN}) 
    }       
</select>

DAO Interface:

String resetRecs(@Param("xCode") int xCode,
            @Param("yCode") int yCode,
            @Param("xyzNum") int xyzNum, @Param("xyzSrc") String xyzSource,
            @Param("retVal") String retVal);

I'm using Mybatis 3.4.0, any help would be greatly appreciated.

0

1 Answer 1

3

I was able to fix this when I updated my mapper call statement in one line.

<select id="resetRecs" resultType="String"   statementType="CALLABLE">  
{#{retVal,mode=OUT,jdbcType=VARCHAR} = call actions.reset_recs(#{xCode, jdbcType=DECIMAL,mode=IN},#yCode,jdbcType=DECIMAL,mode=IN},#xyzNum,jdbcType=DECIMAL,mode=IN},#{src,jdbcType=VARCHAR,mode=IN})}      

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.