开发者

How to call function over data being passed in ibatis

开发者 https://www.devze.com 2023-02-23 23:06 出处:网络
I need to call a internal function say \'calculateValue(value)\' which returns some string based on the value passed.

I need to call a internal function say 'calculateValue(value)' which returns some string based on the value passed.

<select id="calculateValue" resultClass="java.lang.String" parameterClass="java.lang.String">
  SELECT calculateValue(#value#) FROM SYSIBM.SYSDUMMY1
</select>

the above query returns the below error.

com.ibatis.common.jdbc.exception.NestedSQLException:

--- The error occurred in mymapsql.xml.

--- The error occurred while executing query.

--- Check the SELECT calculateValue(?) FROM SYSIBM.SYSDUMMY1 .

--- Check the SQL Statement开发者_StackOverflow中文版 (preparation failed).

--- Cause: java.sql.SQLException: [SQL0418] Use of parameter marker not valid.

how to call the function calculateValue() on the value being passed as parameter?


use procedure tag <procedure> for calling stored procedure.

<procedure id="procId" resultClass="ResultClass"
          parameterMap="getMap">
{ call getResult( #param# ) } 
</procedure>
0

精彩评论

暂无评论...
验证码 换一张
取 消