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 Yusuf <Yu...@ekalife.co.id> on 2006/04/21 03:21:54 UTC

Invalid Column Type issue in confluence

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.


Re: Invalid Column Type issue in confluence

Posted by Nathan Maves <Na...@Sun.COM>.
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.
>