It's the same in Oracle if you define it as CHAR.
I only use CHAR when the value always exactly has the defined length.
Otherwise you should use VARCHAR.
In fact, that’s what VARCAHR is for.

Because this is SQL style behaviour, I would not recommend changing anything in 
Emprie-db as it may result in unexpected behaviour.

Regards,
Rainer


> from: Jan Glaubitz <[email protected]>
> to: [email protected]
> subject: Problem using empire-jsf SelectInputControl with Enum and CHAR
> 
> Hi all,
> 
> I’m using the empire-jsf SelectInputControl with a column thats defined as
> CHAR(2). Recently I added a new option that has only one char, I can set the
> value, but its never rendered in read-only mode.
> 
> I figured out that the length of the String in java, which comes from the
> postgres jdbc driver is always 2. So my new option „B“ is really „B „. This is
> really strange, when I do "SELECT COLUMN, LENGTH(COLUMN)“ postgres
> says its 1.
> 
> Can anyone test if that is a jdbc-specific thing and is the same on e. g. 
> Oracle?
> 
> I worked around that problem for now overriding
> SelectInputControl.formatValue and trimming the value. But maybe there
> should be a general solution?
> 
> - jan

Reply via email to