You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Sundar Sankar <fa...@gmail.com> on 2008/07/15 23:37:03 UTC

Passing an object to Stored procedure.

Hi,
     I have a stored procedure that takes an in parameter of an Oracle
object (varchar col1, varchar col2, float col3). How do I call such a stored
proc from Ibatis.


Any help is appreciated.

Thanks
Sundar

Re: Passing an object to Stored procedure.

Posted by Sundar Sankar <fa...@gmail.com>.
Hi Larry,
           Can you give me an example.

I tried using a typehandler for the same and it didnt work. I am new into
the world of stored procedures and dont know if I did something wrong there.

The code I did in the setParameter() of the Typehandler was

StructDescriptor aaStructuredDescriptor =
StructDescriptor.createDescriptor("oracleType",conn);

                Object [] attributes = {value1, value2, value3};
                parameter = new STRUCT(aaStructuredDescriptor ,
underLyingConnection, attributes);
setter.setObject(parameter);

I get a java.sql.SQLException: Invalid column type

-S


On Tue, Jul 15, 2008 at 2:50 PM, Larry Meadors <la...@gmail.com>
wrote:

> I've not tried this...but you may be able to do it with an anonymous
> pl/sql block.
>
> Larry
>
>
> On Tue, Jul 15, 2008 at 3:37 PM, Sundar Sankar <fa...@gmail.com>
> wrote:
> > Hi,
> >      I have a stored procedure that takes an in parameter of an Oracle
> > object (varchar col1, varchar col2, float col3). How do I call such a
> stored
> > proc from Ibatis.
> >
> >
> > Any help is appreciated.
> >
> > Thanks
> > Sundar
> >
>

Re: Passing an object to Stored procedure.

Posted by Larry Meadors <la...@gmail.com>.
I've not tried this...but you may be able to do it with an anonymous
pl/sql block.

Larry


On Tue, Jul 15, 2008 at 3:37 PM, Sundar Sankar <fa...@gmail.com> wrote:
> Hi,
>      I have a stored procedure that takes an in parameter of an Oracle
> object (varchar col1, varchar col2, float col3). How do I call such a stored
> proc from Ibatis.
>
>
> Any help is appreciated.
>
> Thanks
> Sundar
>