Subject Re: constants interpreted as char instead of varchar
Author jrodenhi
I know what you are saying about it becoming unreadable. I've worked
with MS-SQL, Oracle SQL and Firebird SQL. SQL code can become
write-only pretty quickly. The thing I have really liked about
Firebird is that I can extend the TUDF library pretty easily to get
just the function result I want. If you can do that, you can make
your Firebird SQL much more readable and get results that are hard to
achieve any other way.


--- In firebird-support@yahoogroups.com, "woodsmailbox"
<cosmin.apreutesei@...> wrote:
>
> > case when 1 = 1 then 'a' else 'ab' end || 'c'
>
> case acts as decode, so it also returns 'a c'.
>
> ...but consider this ugly piece (sometimes not even trim is a solution
> as you see below, when I need to specify padding):
>
> decode(a.allow_multivalue, 1, 'LIST ', cast('' as varchar(1)))||
> decode(a.is_boolean, 1, '*',
> decode(a.is_scalar, 1, 'Scalar',
> trim(decode(a.is_blob, 1, 'Text(Large)', 'Text')))||
> decode(a.is_lang_neutral, 1, '', ' ML'))
>