ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Henrique Ferreira e Silva <dhsi...@gmail.com>
Subject Re: Stored Procedures
Date Fri, 28 Oct 2005 21:19:52 GMT
Hi Roberto,

Does your procedure return values using OUT parameters or it does it
like in a function?
If it does that using OUT parameters you have to declare a parameter
map, declaring each parameter with their modes (IN, OUT, INOUT). In
regard of functions, i guess you should have to use a different
syntax. But i'm not sure about this one as i never used iBATIS calling
functions. But i guess it might be like calling functions from
straight JDBC.
Let's wait for the iBATIS commiters comment on this.

Hope that helped,
Daniel Silva.

PS: Good to see another brazilian in this list ;-)



On 10/27/05, Roberto Jr. <roberto@softsite.com.br> wrote:
>
> Hi everyone.
>
> I'm having this problem and i have no idea of how solve it.
> I have a stored procedure that makes some inserts and updates, besides create temp tables
..., that returns some data after all. It's something like that:
>
> CREATE PROCEDURE sp_return_venc ...
> ...
> INSERT INTO....
> ..
> UPDATE..
> ...
> SELECT * FROM TEMP
>
> So I have a procedure that returns a lot of columns.
> I tried to use it like a normal procedure
>
> <procedure
>                 id="br.com.adn.predial.model.sqlmap.Medicao.retrieveVencimentosMedicao2"
>                 resultClass="java.util.HashMap">
>
>                 exec sp_return_venc '003', '2006-01-01', 1000, 1
>
> </procedure>
>
> but it throws an exception
>
> org.springframework.jdbc.UncategorizedSQLException: (SqlMapClientTemplate): encountered
SQLException [
> --- The error occurred in br/com/adn/predial/model/sqlmap/Medicao.xml.
> --- The error occurred while applying a parameter map.
> --- Check the br.com.adn.predial.model.sqlmap.Medicao.retrieveVencimentosMedicao2-InlineParameterMap.
> --- Check the results (failed to retrieve results).
> --- Cause: java.lang.NullPointerException]; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
> --- The error occurred in br/com/adn/predial/model/sqlmap/Medicao.xml.
> --- The error occurred while applying a parameter map.
> --- Check the br.com.adn.predial.model.sqlmap.Medicao.retrieveVencimentosMedicao2-InlineParameterMap.
> --- Check the results (failed to retrieve results).
> --- Cause: java.lang.NullPointerException
> com.ibatis.common.jdbc.exception.NestedSQLException:
> --- The error occurred in br/com/adn/predial/model/sqlmap/Medicao.xml.
> --- The error occurred while applying a parameter map.
> --- Check the br.com.adn.predial.model.sqlmap.Medicao.retrieveVencimentosMedicao2-InlineParameterMap.
> --- Check the results (failed to retrieve results).
> --- Cause: java.lang.NullPointerException
> Caused by: java.lang.NullPointerException
>         at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:188)
>
> If i execute a procedure that just return values or a procedure that just alter some
data in tables but don't return values, it works, but if i execute a procedure that alter
data in tables and return values, so it doesn't work.
>
> Does anybody knows something for me?
>
> Thank's a lot.
> __________________________
> Roberto C. Lima Jr.
> SoftSite Mobile.
> www.softsite.com.br
>

Mime
View raw message