ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From puneet arya <puneet_arya_...@yahoo.co.in>
Subject how to use function in resultMap
Date Wed, 28 Jun 2006 05:57:49 GMT
Hi, 
     I am trying to use sum function (Pl/Sql) in my stored procedure as  
   
  select sum(salary) from employeeInfo;
   
  But while defining a result Map i m writing as
  <resultMap id="spEmployeeInfo" class = "employee">
  <result property="name" column = "NAME"/>
  <result property="salary" column = "SALARY"/>
  </resultMap>
  and in parameterMap 
   
  <parameterMap id = "inputEmployeeMap" class = "employeeMap" >
  <parameter property="name" jdbcType="VARCHAR2" avaType="java.lang.String" mode="IN"/>
  <parameter property="outputname" jdbcType="ORACLECURSOR" mode = "OUT" resultMap = "spEmployeeInfo"
/>
  </parameterMap>
   
  <procedure id = "getEmployeeList" parameterMap="inputEmployeeMap" resultMap="spEmployeeInfo">
  { call SP_EMPLOYEE(?, ?) }
  </procedure> 
   
  But because i m using the sum function so it is giving error like
   
   The error occurred while applying a result map.
 Check the Employee.spEmployeeInfo.
 Check the result mapping for the 'salary' property.
 Cause: java.sql.SQLException: Invalid column name
   
  So how to Use the sum function in my case,,please suggest
  Regards,
  Puneet Arya

 				
---------------------------------
 Yahoo! India Answers: Share what you know. Learn something new Click here
Catch all the FIFA World Cup 2006 action on Yahoo! India Click here
Mime
View raw message