Hi all,

I am having a strange problem regarding prepared queries with Umlaute (e.g., ä). It seems that the rule for type casting strings correspond to the length of the string. The problem is
that an Umlaut seems to count for two "normal" characters. Here is an example. Consider the following simple table:

create table A (a varchar(4));


Now if we create a prepared statement (ultimately I want to do this from Java) such as


prepare select * from A where a = ?;


we can execute the statement and supply 4 characters as the argument:


exec 3('1234');


This works fine. However, if I am using an Umlaut within the parameter, then things don't work out. For example


exec 4('ä123');


fails with the following error message


EXEC: wrong type for argument 1 of prepared statement: char, expected varchar


However, if I now shorten the parameter by "1" character, it works again. That is,


exec 5('ä12');


is ok. 


Can anybody explain this behavior? Is this a bug? And is there a workaround? The only thing I came up with so far is to double the size of every column.


Best regards,

Arno