ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bing Qiao <qiaob...@gmail.com>
Subject Re: INSERT disrupts Resultset from Stored Procedure?
Date Wed, 29 Jun 2005 08:24:43 GMT
Sorted it out.

I put a SET NOCOUNT ON in the beginning of the stored procedure, which
prevents the number of rows affected by a Transact-SQL statement from
being returned as part of the results.

Cheers

Bing

On 6/28/05, Bing Qiao <qiaobing@gmail.com> wrote:
> Dear all,
> 
> Another stored procedure issue.
> 
> I can't have the following INSERT INTO statement in my stored
> procedure. Otherwise, the queryForList won't work (throwing
> exception).
> 
> Does this insert incur any resultset as well?
> 
> Many thanks,
> 
> Bing
> 
> ///////////////////////////////////////
> Stored Procedure:
> 
> DECLARE @ACT TABLE (PAYMENTID INT, ACT BIT)
> 
> INSERT INTO @ACT  (PAYMENTID, ACT) values (1,1)
> 
> SELECT top 30000
> 1 AS PAYMENTID,
> 'L' AS FIRMID,
> .....
> .....
> //////////////////////////////////////////
> Call from java:
> 
> list = (List) sqlmap.queryForList("TPayment-search", tpayment);
> /////////////////////////////////////////
> Exception:
> 
> com.ibatis.common.jdbc.exception.NestedSQLException:
> --- The error occurred in treasury/ibatis/T_PAYMENT.xml.
> --- The error occurred while applying a parameter map.
> --- Check the T_PAYMENT.TPaymentParam.
> --- Check the results (failed to retrieve results).
> --- Cause: java.lang.NullPointerException
> Caused by: java.lang.NullPointerException
>        at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWit
> /////////////////////////////////////////
>

Mime
View raw message