ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason King <jhk...@airmail.net>
Subject Re: IBATIS issue while using Oracle stored proc returning output cursor with null column
Date Mon, 31 Aug 2009 16:13:30 GMT
You might want to try select first_name firstname, last_name lastname , 
'' as designation from employee

In Oracle the empty string '' is also null.  My suspicion is the problem 
here is the Oracle jdbc driver not knowing what the designation column's 
datatype is, is setting up something bizarre to account for any 
possibility, hence the memory consumption.  The empty string ('') while 
null, should wind up getting typed as a varchar so that may alleviate 
the problem.
If that doesn't work, I'd try joining employees to some other (small) 
table and grabbing a column you know is null from that table. 
For example.
create table party_ethics ( party_name, varchar2(10) , 
ethical_constraints varchar2(10));
insert into party_ethics values ('Democrat',NULL);
insert into party_ethics values ('Republican',NULL);
select first_name,
         ethical_constraints as designation
from employees ,
where party_name = 'Democrat'

That will get you a varchar2(10) column with a null value in it.

Sankar Reddy wrote:
> Say for example:
> OPEN emp FOR 
> First_name as FIRSTNAME,
> Last_name as LASTNAME,
>             NULL as DESIGNATION
>             EMPLOYEE
> Now the resultMap would look like this:
> <resultMap id="getEmployees" class="employeesDTO" >
>                                     <result property="firstName"
> column="FIRSTNAME" />
>                                     <result property="lastName"
> column="LASTNAME" />                              
>                                     <result property="desig"
> column="DESIGNATION" />
> </resultMap>

To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org

View raw message