ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <guillen.olmos.an...@servexternos.repsolypf.com>
Subject RV: Problem with Stored Procedure SQLServer + iBatis
Date Tue, 30 Oct 2007 09:49:35 GMT
> Hello
> 
> I have a problem mapping a stored procedure of SQL SERVER from iBATIS.
> 
> This is my sqlMap:
> 
> 	<resultMap id="paisesPorDGPorUNResult" class="paisesMulti">
> 		<result property="intIdPais" column="intIdPais" jdbcType="INTEGER" javaType="java.lang.String"/>
> 		<result property="nombrePais" column="NombrePais"/>
> 	</resultMap> 
> 
> 	<procedure id="getPaisesPorDGPorUN" parameterClass="unidadesNegocio" resultMap="paisesPorDGPorUNResult">
> 		{call dbo.proc_IMPUESTOSPAGADOS_SELECT_Devuelve_DirGen_UniNegPais_Paises   (#strIdioma:VARCHAR#,#strUsuario:VARCHAR#,
				#intIdDireccionGeneral:INTEGER#,#intIdUniNegImpPag:INTEGER#)}	
> 	</procedure>
> 
> The DB Server is a SQLServer 2000 but we are using the SQLServer 2005 JBDC Driver (because
it fix a bug that causes problems working with iBatis)
> 
> When I execute this procedure i have this exception:
> 
> Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:   
> --- The error occurred in com/repsolypf/srf/adm/imptopag/dominio/DireccionesGenerales.xml.
 
> --- The error occurred while applying a result map.  
> --- Check the DireccionesGenerales.paisesPorDGPorUNResult.  
> --- Check the result mapping for the 'intIdPais' property.  
> --- Cause: com.microsoft.sqlserver.jdbc.SQLServerException: The column name intIdPais
is not valid.
> 
> The column name is ok when I execute this procedure from SqlServer client, this is the
SP:
> 
> CREATE PROCEDURE [dbo].[proc_IMPUESTOSPAGADOS_SELECT_Devuelve_DirGen_UniNegPais_Paises]
> 	@chrIdioma char(2),
> 	@chrUsuario varchar(25),
> 	@intIdDireccionGeneral int,
> 	@intIdUniNegImpPag int
> 
> /**** MORE ***/
> 
> 					'SELECT intIdPais,' +  @NombrePais  + '
> 					FROM ImpuestosPagados_DirGen_UniNegPais 
> 					INNER JOIN Paises_Paises 
> 					ON ImpuestosPagados_DirGen_UniNegPais.intIdPais = Paises_Paises.intIdPais'
> 				
> /***** MORE ****/
> 
> END
> GO
> 
> Do you know where is the problem? I can't see it.
> 
> Greetings and thanks
>  
> Angel Guillén
> 

Mime
View raw message