Subject | Weird behavior of case when using string as return |
---|---|
Author | Jiri Cincura |
Post date | 2006-08-11T19:34:56Z |
Hi *,
when you run:
select
case 0
when 1 then 'looooooooong'
else 'short'
end
|| 'next'
from rdb$database
union all
select
case 1
when 1 then 'looooooooong'
else 'short'
end
|| 'next'
from rdb$database
you'll get:
PLAN (RDB$DATABASE NATURAL)
PLAN (RDB$DATABASE NATURAL)
================
short next
looooooooongnext
Why is the 'short' string right-padded to length of 'looooooooong'? Can I
remove this spaces using some easy steps (i.e. not using rtrim UDF, ...).
Thanks for replies.
Tested on FB1.5.3, FB2.0 RC3.
--
Jiri {x2} Cincura
http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com
when you run:
select
case 0
when 1 then 'looooooooong'
else 'short'
end
|| 'next'
from rdb$database
union all
select
case 1
when 1 then 'looooooooong'
else 'short'
end
|| 'next'
from rdb$database
you'll get:
PLAN (RDB$DATABASE NATURAL)
PLAN (RDB$DATABASE NATURAL)
================
short next
looooooooongnext
Why is the 'short' string right-padded to length of 'looooooooong'? Can I
remove this spaces using some easy steps (i.e. not using rtrim UDF, ...).
Thanks for replies.
Tested on FB1.5.3, FB2.0 RC3.
--
Jiri {x2} Cincura
http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com