Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 67633 invoked from network); 11 Sep 2008 20:26:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Sep 2008 20:26:20 -0000 Received: (qmail 61414 invoked by uid 500); 11 Sep 2008 20:26:15 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 61399 invoked by uid 500); 11 Sep 2008 20:26:15 -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 61388 invoked by uid 99); 11 Sep 2008 20:26:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Sep 2008 13:26:14 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of deadmoro3@gmail.com designates 64.233.166.181 as permitted sender) Received: from [64.233.166.181] (HELO py-out-1112.google.com) (64.233.166.181) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Sep 2008 20:25:16 +0000 Received: by py-out-1112.google.com with SMTP id x79so407078pyg.21 for ; Thu, 11 Sep 2008 13:25:48 -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:in-reply-to:mime-version:content-type:references; bh=moa5a3tmc/eXgAAu69cnCE6dIjUpKRNBhC054czJmg8=; b=Zc4d2HNKrohEYnqfd3E0pfTLonrPomtRoSS2LSJVW7+2WW9vynnqAQR5rIij/HJr+g nRil/v0Z1E0D8uHb/ubhNGpSy3D6N6gx/HOYWpFhmbBKAq9JqGdNEaVUmzd24Q+jXqZV N9kvbexWrm9VT4gL7GutBNih1Ok/3jHdA+dvE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=XR0Bi1rcxYzthJahB+QQ3OQOyEDzuhlyP1QOlDjUg3m9hgE+UO8CGbxDRGw6WMUYrX DXbWNtt3kKo/M3p/6Ja+EKcyw+0gqSegqjze5F3YzlahtwRTU5Fk8bTaTTk7G45MPtil 5I3Rf6CcgFYybbcKktMX/7vcKPgrCzha+YsJo= Received: by 10.114.195.19 with SMTP id s19mr2599618waf.189.1221164747963; Thu, 11 Sep 2008 13:25:47 -0700 (PDT) Received: by 10.114.241.20 with HTTP; Thu, 11 Sep 2008 13:25:47 -0700 (PDT) Message-ID: Date: Thu, 11 Sep 2008 23:25:47 +0300 From: Vadim To: user-java@ibatis.apache.org Subject: Re: ORA-06572: Function has OUT parameters In-Reply-To: <16178eb10809110743u43c2a357x9469b9f6ceff362b@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_10789_33460821.1221164747961" References: <16178eb10809110743u43c2a357x9469b9f6ceff362b@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_10789_33460821.1221164747961 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I didn't really get your solution. My problem is - you can't have a function returning a value AND having an OUT parameter in a SQL statement.Question is: if I convert function 'with_out' to a procedure with one more OUT parameter with_out (#in,mode=IN,jdbcType=VARCHAR#,#out,mode=OUT,jdbcType=VARCHAR#, #result,mode=OUT,jdbcType= ????? #) ) where #result# is TYPE some_type AS TABLE OF some_object how do I map it to a list of java classes? Is it possible with the help of a typehandler? On Thu, Sep 11, 2008 at 5:43 PM, Clinton Begin wrote: > Try this, if it's too much to put in your SQL, you can use an external > parameter map. > > #in,jdbcType=VARCHAR,mode=OUT#, > #out,jdbcType=VARCHAR,mode=OUT# > > Clinton > > > On Thu, Sep 11, 2008 at 7:09 AM, Vadim wrote: > > Hello, > > > > I've been thinking how to do this for too long now. Ibatis version is > > 2.1.0.565, Oracle version is 9. What I'm trying to do is map a statement > to > > a Java class and get one varchar OUT parameter. PL/SQL function is like > > > > function with_out ( > > in_param in varchar2, > > out_message out varchar2 > > ) return some_type; > > > > TYPE some_type > > AS TABLE OF some_object > > > > TYPE SOME_OBJECT as object ( > > id number(9), > > class varchar2(16) > > ); > > > > class SomeClass{ > > [id, class] setters, getters (as usual) > > } > > > > > > > > IbatisDatastore.getSqlMapInstance().queryForList("someSelect", paramMap); > > > > That's what I have now and what gives me a 'Function has an OUT > parameter' > > error. One solution I see is changing function to procedure and adding > one > > more out parameter. Unfortunately, I'm not familiar with Ibatis enough to > be > > able to map 'some_type' OUT parameter to 'SomeClass'. > > Would be grateful for any advice you can give! > > > > > ------=_Part_10789_33460821.1221164747961 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
I didn't really get your solution. My problem is - you can't have a function returning a value AND having an OUT parameter in a SQL statement.Question is: if I convert function 'with_out'

<select id="someSelect"
       resultClass="SomeClass">

        SELECT  id, class
        FROM TABLE(with_out (#in,mode=IN,jdbcType=VARCHAR#,#out,mode=OUT,jdbcType=VARCHAR#) )
</select>

 to a procedure with one more OUT parameter

<procedure id="someSelect">
        with_out (#in,mode=IN,jdbcType=VARCHAR#,#out,mode=OUT,jdbcType=VARCHAR#, #result,mode=OUT,jdbcType= ????? #) )
</procedure>

where #result# is
TYPE some_type AS TABLE OF some_object

how do I map it to a list of java classes? Is it possible with the help of a typehandler?


On Thu, Sep 11, 2008 at 5:43 PM, Clinton Begin <clinton.begin@gmail.com> wrote:
Try this, if it's too much to put in your SQL, you can use an external
parameter map.

#in,jdbcType=VARCHAR,mode=OUT#,
#out,jdbcType=VARCHAR,mode=OUT#

Clinton


On Thu, Sep 11, 2008 at 7:09 AM, Vadim <deadmoro3@gmail.com> wrote:
> Hello,
>
> I've been thinking how to do this for too long now. Ibatis version is
> 2.1.0.565, Oracle version is 9. What I'm trying to do is map a statement to
> a Java class and get one varchar OUT parameter. PL/SQL function is like
>
> function with_out (
>     in_param     in varchar2,
>     out_message    out varchar2
> ) return some_type;
>
> TYPE some_type
>  AS TABLE OF some_object
>
> TYPE SOME_OBJECT as object (
>     id            number(9),
>     class  varchar2(16)
> );
>
> class SomeClass{
> [id, class] setters, getters (as usual)
> }
>
> <select id="someSelect"
>        resultClass="SomeClass">
>
>         SELECT  id, class
>         FROM TABLE(with_out (#in:VARCHAR#,#out:VARCHAR#) )
> </select>
>
> IbatisDatastore.getSqlMapInstance().queryForList("someSelect", paramMap);
>
> That's what I have now and what gives me a 'Function has an OUT parameter'
> error. One solution I see is changing function to procedure and adding one
> more out parameter. Unfortunately, I'm not familiar with Ibatis enough to be
> able to map 'some_type' OUT parameter to 'SomeClass'.
> Would be grateful for any advice you can give!
>
>

------=_Part_10789_33460821.1221164747961--