Subject Re: [firebird-support] Fw: An empty string in a CASE expression will result in a space
Author Ann W. Harrison
At 02:30 PM 2/13/2004, Ivan Prenosil wrote:
> > It seems that an empty string used in a CASE expression is converted to a
> > space:
> >
> > SELECT 'aa' || CASE WHEN (1 = 1) THEN '' ELSE 'x' END || 'bb'
> > FROM rdb$database
> >
> > This will result in 'aa bb' with a space between aa and bb. I expect 'aabb'
>
>Both string literals '' and 'x' are of type CHAR, not VARCHAR,
>and so the result is converted to CHAR with the length of the longer one,
>i.e. CHAR(1).

Why is 'x' a char rather than a varchar?

regards,

Ann