db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@apache.org>
Subject Re: Collation and parameter markers (?)
Date Tue, 05 Jun 2007 20:30:58 GMT
Mamta Satoor wrote:
> I realize that we are still discussing what should be the right 
> collation for different character string type instances, but I want to 
> put out cases which will hopefully aid in making a decision or expose 
> different scenarios.
> Consider following case for parameter with CAST.
> select * from customer where CAST(? as char(10)) = name
> The CAST node will assign the DTD associated with char(10) to the ?. But 
> what should be the collation type for char(10). Currently in the code, 
> it is UCS_BASIC and hence ? ends up getting UCS_BASIC. As a result, the 
> result of the CAST operand gets a collation type of UCS_BASIC amd the 
> comparison against "name" fails with compilation time error. Now doing a 
> CAST on "name" is not an option to fix this problem because CAST(name as 
> char(10)) will result in a character string type with collation of 
> territory based. So, the question is what should be the collation type 
> of char(10) in the eg above?

Why would the two casts be different here? What makes one UCS_BASIC and 
the other territory based?


View raw message