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 "Rao, Satish" <sa...@fmr.com> on 2005/08/10 22:09:29 UTC
Complex type as IN parameter
In one of our stored procedure, we have the following declaration
TYPE TBL_ORD_ID IS TABLE OF TEST_TABLE.ORD_ID%TYPE;
PROCEDURE PRC_ORDER_S
(
IN_TBL_ORD_ID IN TBL_ORD_ID,
...................
Functionally, I can call that stored procedure with a single orderId or
a list of orderIds as input.
What would the entry for jdbcType and javaType in the sqlmap be?
<parameter property="orderId" mode="IN" jdbcType="?"
javaType="?"/>
Re: Complex type as IN parameter
Posted by Prashanth Sukumaran <pr...@yahoo.com>.
Hi Satish,
I see that Ibatis has a JDBCTypeRegistry.java that defines all the different JDBCTypes. It has a
reference to
setType("ARRAY", Types.ARRAY);
May be you can pass a array to the Stored Procedure if not a list.
I don't know if there is documentation for this.
Can any of the iBatis developers help with this?
Thanks
Prashanth Sukumaran.
--- Koka <22...@gmail.com> wrote:
> Well, as far as I know in Oracle passing arrays to Prepared/Callable
> procedures is posible BUT is part of Oracle extensions, i.e. requires
> casts to OraclePreparedStatement and OracleCallableStatement.
>
> So at least with Oracle it will be impossible (as SqlExecutor
> explicitely uses java.sql.CallableStatement) unless one starts
> modifying iBatis code.
>
> Good luck
> Koka
>
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs
Re: Complex type as IN parameter
Posted by Koka <22...@gmail.com>.
Well, as far as I know in Oracle passing arrays to Prepared/Callable
procedures is posible BUT is part of Oracle extensions, i.e. requires
casts to OraclePreparedStatement and OracleCallableStatement.
So at least with Oracle it will be impossible (as SqlExecutor
explicitely uses java.sql.CallableStatement) unless one starts
modifying iBatis code.
Good luck
Koka
Re: Complex type as IN parameter
Posted by Prashanth Sukumaran <pr...@yahoo.com>.
Hi Satish,
You must be using a iterator if you are passing a List as a parameter right. Also
you have defined TBL_ORD_ID as TEST_TABLE.ORD_ID%TYPE.
I have never heard of any database that defines/has a list Data Type. Is there any???
If not then defined the type of ORD_ID.
Rgds
Prashanth Sukumaran.
--- "Rao, Satish" <sa...@fmr.com> wrote:
> In one of our stored procedure, we have the following declaration
>
> TYPE TBL_ORD_ID IS TABLE OF TEST_TABLE.ORD_ID%TYPE;
>
> PROCEDURE PRC_ORDER_S
> (
> IN_TBL_ORD_ID IN TBL_ORD_ID,
> ...................
>
> Functionally, I can call that stored procedure with a single orderId or
> a list of orderIds as input.
>
> What would the entry for jdbcType and javaType in the sqlmap be?
>
> <parameter property="orderId" mode="IN" jdbcType="?"
> javaType="?"/>
>
>
>
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs