Subject | Re: [firebird-support] Fw: An empty string in a CASE expression will result in a space |
---|---|
Author | Ann W. Harrison |
Post date | 2004-02-13T20:04:01Z |
At 02:30 PM 2/13/2004, Ivan Prenosil wrote:
regards,
Ann
> > It seems that an empty string used in a CASE expression is converted to aWhy is 'x' a char rather than a varchar?
> > 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).
regards,
Ann