ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Maves <Nathan.Ma...@Sun.COM>
Subject Re: Invalid Column Type issue in confluence
Date Fri, 21 Apr 2006 15:23:43 GMT
The first option should work fine.  Are you positive that it is not  
one of your other columns causing the issue?

Nathan

On Apr 20, 2006, at 7:21 PM, Yusuf wrote:

> Hi,
> In the faq page about null value inserts in here:
> http://opensource.atlassian.com/confluence/oss/display/IBATIS/What 
> +cause
> s+an+Invalid+column+type+error+with+Oracle
> said that you can do something like this and you can prevent the
> misleading error 'Invalid Column Type' if the value in line2 and
> sold_date is null :
>
> <insert id="insertAddress" parameterClass="Address">
>         INSERT INTO
>             ADDRESS (
> 		line1,
> 		line2,
> 		city,
> 		state,
> 		postal_code,
> 		purchase_date,
> 		sold_date	
>                 )
>             values (
>                 	#line1#,
> 		#line2:VARCHAR#,
> 		#city#,
> 		#state#,
> 		#postal_code#,
> 		#purchase_date#,
> 		#sold_date:DATE#	
>             )
> </insert>
>
> But this solution never works for me (or maybe for oracle..),  
> instead i
> always have to do something like :
>
> <insert id="insertAddress" parameterClass="Address">
>         INSERT INTO
>             ADDRESS (
> 		line1,
> 		line2,
> 		city,
> 		state,
> 		postal_code,
> 		purchase_date,
> 		sold_date	
>                 )
>             values (
>                 #line1#,
> 		<isNull property="line2">
> 			null,
> 		</isNull>
> 		<isNotNull property="line2">
> 			#line2#,
> 		</isNotNull>
> 		#city#,
> 		#state#,
> 		#postal_code#,
> 		#purchase_date#,
> 		#sold_date#	
>             )
> </insert>
>
> I was wondering if someone actually having the same problem with me,
> currently i'm using
> - iBATIS 2.1.5 build 582
> - oracle 8.1.7
> - oracle10g jdbc thin driver (ojdbc14.jar)
> - c3p0 0.9.0.2
>
> Thanks :)
> Yusuf.
>


Mime
View raw message