If it is long, and not Long (little "l" instead of big "L") you will not be able to use nulls - long values cannot be null; only Long values can.
Larry On 5/26/05, Jason Hall <[EMAIL PROTECTED]> wrote: > im using java data type long. > > the section with NUMERIC: is commented out - if you noticed. > > > -----Original Message----- > From: Paul Barry [mailto:[EMAIL PROTECTED] > Sent: Thursday, May 26, 2005 4:07 PM > To: ibatis-user-java@incubator.apache.org > Subject: Re: Handling Null value In Oracle - Everything fine but 1 > problem > > > Is id an Integer or an int? > > Also, the syntax in your example has: > > #id:NUMERIC:# > > It should be: > > #id:NUMERIC# > > Not sure if that is causing a problem. > > On 5/26/05, Jason Hall <[EMAIL PROTECTED]> wrote: > > > > > > 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> >