hi,
Yes You are right ki should not have name in the resultMap but alias we cant put like that . not only in this case(where i m using sum function) but in the normal case when we are using resultMap alias can't be used .
Regards,
Puneet Arya
[EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote:
but if in yout select you only have the salary column and not the name you must erase the name column in the resultmap....
<resultMap id="spEmployeeInfo" class = "employee">
<result property="salary" column = "SALARY"/>
</resultMap>
and to put the alias "salary" in the pl select.
![]()
Esperanza Echeverría de Miguel
Steria España http://www.steria.es
C/Menéndez y Pelayo,3 bis 46010 Valencia
Tel: + 34 96 393 87 50 Fax: +34 96 393 87 51
[EMAIL PROTECTED]
puneet arya <[EMAIL PROTECTED]> 28/06/2006 07:39
Please respond to user-java
To: [email protected]
cc:
Subject: how to use function in resultMap
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
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
- Re: how to use function in resultMap puneet arya
- Re: how to use function in resultMap Esperanza . Echeverria
- Re: how to use function in resultMap puneet arya
- Re: how to use function in resultMap Esperanza . Echeverria
- Re: how to use function in resultMap puneet arya
- Re: how to use function in resultMap Esperanza . Echeverria
- Re: how to use function in resultMap Viktor_X . _Kopit
Reply via email to
