db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristian Waagan <Kristian.Waa...@Sun.COM>
Subject Re: ERROR 42X89: Types 'INTEGER' and 'CHAR' are not type compatible. Neither type is assignable to the other type.
Date Thu, 27 Jul 2006 19:53:06 GMT
Peterson, John wrote:
> Hello,
>  
> It was reported to me that one of the reasons our software currently
> doesn't work with Apache Derby is because of ERROR 42X89.  One of the
> engineering teams reported: "We found that there is a bug in Derby in
> its support for the Case statement. There is a workaround but that will
> require us to change the SQL generation code to specifically check if
> we're connected to Derby and generate a different SQL syntax."  After
> inquiring after the specifics, I was provided with the following
> example: 
>  
> ij>values case when 1=2 then 3 else NULL end; 
> ERROR 42X89:  Types 'INTEGER' and 'CHAR' are not type compatible.
> Neither type is assignable to the other type.
>  
> Is this indeed a bug (that will be fixed in the future), or is Derby
> behaving as it was intended?

Hello John,

I can't answer your specific question, but what is the workaround you
know of?

For instance, changing the query to "values case 1=2 then 3 else
case(NULL as INT) end;", makes it work. Maybe this is supported by (all)
other database systems as well.

Seems to me Derby should be able to handle this on its own, but I know
very little about this issue. I'm sure someone with more knowledge about
 the implementation of this part of Derby will speak up.
It would also be good to know what is said in the standards on this issue.



Regards,
-- 
Kristian

>  
> Thanks for your help,
> John
>
> 


Mime
View raw message