Subject | Re: Can't trim |
---|---|
Author | kimon_the_athenian2 |
Post date | 2004-10-30T10:10:54Z |
Hi!
I was too fast complaining. Just found a solution myself, need to
cast result to a varchar:
select
cast (rtrim (case when (1 < 2)
then 'this'
else 'blahblah'
end) as varchar (20))
from dual
thanks for reading my monologue :)
Aivar
--- In firebird-support@yahoogroups.com, "kimon_the_athenian2"
<kimon_the_athenian2@y...> wrote:
I was too fast complaining. Just found a solution myself, need to
cast result to a varchar:
select
cast (rtrim (case when (1 < 2)
then 'this'
else 'blahblah'
end) as varchar (20))
from dual
thanks for reading my monologue :)
Aivar
--- In firebird-support@yahoogroups.com, "kimon_the_athenian2"
<kimon_the_athenian2@y...> wrote:
>
> Hi!
>
> when i run this query:
>
> select
> case when (1 < 2)
> then 'this'
> else 'blahblah'
> end
> from dual
>
> on FB1.5 then result is 'this ', ie. result is padded to the
> length of 'blahblah'.
>
> tried to use trim like this:
>
> select
> rtrim (case when (1 < 2)
> then 'this'
> else 'blahblah'
> end)
> from dual
>
> (rtrim is from ib_udf.dll)
>
> but now the result is padded with zillion-billion spaces.
>
> How can i get 'this' ?
>
> (I'm using this select in a SP and result gets stored to a varchar
> field)
>
> Thanks!
>
> Aivar