Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 99052 invoked from network); 21 Aug 2008 01:23:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Aug 2008 01:23:24 -0000 Received: (qmail 78193 invoked by uid 500); 21 Aug 2008 01:23:21 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 78179 invoked by uid 500); 21 Aug 2008 01:23:21 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 78168 invoked by uid 99); 21 Aug 2008 01:23:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Aug 2008 18:23:21 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of fcferrari@gmail.com designates 209.85.200.174 as permitted sender) Received: from [209.85.200.174] (HELO wf-out-1314.google.com) (209.85.200.174) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Aug 2008 01:22:24 +0000 Received: by wf-out-1314.google.com with SMTP id 28so664680wfa.27 for ; Wed, 20 Aug 2008 18:22:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=UeGv+iQSFJWRewWqr8flguJBdCNy6uWimvNPnB49WXQ=; b=QDkEOixtFrPwedNiSZF8BtQ34rQ/NU3Arn9BTey44ikaTGf7N2KzmborrPn63bWGcS CfHNNDqAR3rzSMoZE2NDTYEkVx7OPb4IJfkZRYspPqgIFhMjiPiByhIv5LsaPD7XKEv+ 1vVc8hdVwBx6usGcw+3zLXY6Ui4nqRmri8rBw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=Zd/BHQp1OZkyQpNNESWkDvq93h+MhPBCVlRUkeZ2bCzzYkp6OylnRgzQzIdo5HFrFz AmbirbdCAwLFaMHzgrqFp3FOTts0v8BhAp0ajylBuerIl8TVWwRLJ6eb1kT/oVmRdCPU Z2M2B6ssdNk9UrIZIdMCZx8zYqVhlR7VZean4= Received: by 10.143.34.11 with SMTP id m11mr274911wfj.177.1219281764334; Wed, 20 Aug 2008 18:22:44 -0700 (PDT) Received: by 10.142.253.17 with HTTP; Wed, 20 Aug 2008 18:22:44 -0700 (PDT) Message-ID: <48c6964d0808201822x4e8ff95fu2a43d0014e6c7f55@mail.gmail.com> Date: Wed, 20 Aug 2008 22:22:44 -0300 From: "Fabiano Ferrari" To: user-java@ibatis.apache.org Subject: How to run a stored procedure with iBATIS. MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org Hi, all. I need some help to run a stored procedure with iBATIS. Sorry if this question has already circulated in list. When trying to run the procedure, I run into a problem. My database is Oracle 10g Express Edition and I'm currently using iBATIS 2.0 Beta 4. This is the output I get when invoking the procedure within a JUnit test case: 1) testExecuteQueryProcedure(com.ibatis.sqlmap.engine.execution.SqlExecutorTest)com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in com/ibatis/sqlmap/maps/OracleProc-modified.xml. --- The error occurred while applying a parameter map. --- Check the getAccountEmail. --- Check the parameter mapping for the 'email' property. --- Cause: java.sql.SQLException: Cannot perform fetch on a PLSQL statement: next ------------------------------------------------- My JavaCode is: Map param = new HashMap(); param.put("id", new Integer(1)); param.put("email", new String()); String email = (String) sqlMap.queryForObject( "getAccountEmailViaProcedure", param); My SqlMap is: {call get_account_email ( ? ,? )} My Oracle procedure (which works fine when manually invoked) is: PROCEDURE get_account_email (id IN INTEGER, email OUT VARCHAR) IS BEGIN SELECT acc_email INTO email FROM account2 where ACC_ID = id; END; ------------------------------------------------- Thanks for any help. Fabiano