ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Hall" <JH...@cihi.ca>
Subject Handling Null value In Oracle - Everything fine but 1 problem
Date Thu, 26 May 2005 20:00:08 GMT
Hi,

I've tried every scenario from previous mailing-list, wike etc.
I'm using Oracle 9i (tried Oracle 9i & 10g jdbc thin driver)

Everything works, i'm able to insert null data for varchar and ALSO able to insert NUMBER
data type too, but
it's always the value 0 (ZERO) inserted.  For me to get rid of this inserted ZERO  I did a
nullValue "-999" with data type VARCHAR NOT
NUMERIC OR NUMBER. Now this worked!  I was able to get a null value inserted for both VARCHAR
and NUMBER oracle data type.

But my problem is why do i have to use a replacement -999 etc. to insert an empty value?

Is there something that I'm doing wrong?


my sqlmap is

.....
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">

<sqlMap namespace="Dummy">

<parameterMap id="paramMap" class="ca.cihi.omhrs.Dummy" >
  <parameter property="id"  jdbcType="VARCHAR" nullValue="-9999"/>
  <parameter property="name" jdbcType="VARCHAR" />
</parameterMap>

<insert id="insertDummy" parameterMap="paramMap">

insert into Dummy(id,name)
values(?,?)
</insert>

<!--
<insert id="insertDummy" parameterClass="ca.cihi.omhrs.Dummy">

insert into Dummy(id,name)
values(#id:NUMERIC:#,#name:VARCHAR:NO_ENTRY#)
</insert>
-->

</sqlMap>

Mime
View raw message